Item13899: save: ignores new topic text if it is empty
Priority: Urgent
Current State: Closed
Released In: 2.1.0
Target Release: minor
On save, if the new topic text is the empty string, the old topic text is re-used and saved into the new revision.
This is because of the following line in
lib/Foswiki/UI/Save.pm
(line 180 in my version):
$text = $query->param('text') if scalar $query->param('text');
Apparently this fails to distinguish between a missing and an empty
text
parameter.
This probably went in with the big changeset to properly communicate with CGI.pm about multi-param values. I'm not sure about how to fix this without breaking that (my first idea was replacing
scalar
with
defined
and that seems to do the trick). Maybe someone who was involved in the multi-param cleanup has a straightforward idea?
Because this breaks basic editing (a rather special case, though, to be fair), I'm marking this as urgent and for patch release, feel free to re-prioritize.
--
JanKrueger - 21 Dec 2015
Looking at the
"git log -L 180,180:Foswiki/UI/Save.pm"
results, the "if scalar" got added during the unicode patching. It has nothing to do with the multi-param fixes. (The scalar is only needed when in a list context, which is not involved in that line.)
--
GeorgeClark - 21 Dec 2015