You are here: Foswiki>Tasks Web>Item13899 (08 Feb 2016, GeorgeClark)Edit Attach

Item13899: save: ignores new topic text if it is empty

pencil
Priority: Urgent
Current State: Closed
Released In: 2.1.0
Target Release: minor
Applies To: Engine
Component: FoswikiUISave
Branches: master Release02x00 Item13897
Reported By: JanKrueger
Waiting For:
Last Change By: GeorgeClark
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
 
Topic revision: r6 - 08 Feb 2016, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy