Tags:
create new tag
, view all tags

Bug: Checkbox values not restored when editing a form

See DebianBug:152766

Failed to include URL http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=152766 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed) From: Jonathan H N Chin <jhnc%stone@newton.cam.ac.uk> Subject: twiki: need \Q...\E in TWiki::Form::renderForEdit To: submit@bugsPLEASENOSPAM.debian.org X-Mailer: bug 3.3.10.1 Delivered-To: submit@bugsPLEASENOSPAM.debian.org

Package: twiki Version: 20011201-1 Severity: normal

I set up a TWikiForm like:

| *Name:* | *Type: | *Size:* | *Values:* | *Tooltip message:* |
| myfield2 | checkbox | 3 | [[MyWikiWord1][opt1]], [[MyWikiWord2][opt2] | |

and then attach it to a topic.

I edit the topic and set some checkboxes.

Once I have saved the topic, if I re-edit it, the checkbox values are "unset" regardless of what actual value was saved.

I have painfully traced this to TWiki::Form::renderForEdit which does not escape $item when it is used in the checkbox match:

if ( $value =~ /(^|,\s*)$item(,|$)/ ) {

This would be better written as:

if ( $value =~ /(^|,\s*)\Q$item\E(,|$)/ ) {

which would give the expected result (ie. checkboxes are selected).

-- System Information Debian Release: 3.0 Kernel Version: Linux stone 2.2.16int4+usb3 #1 SMP Thu Jul 27 17:18:16 BST 2000 i686 unknown

Test case

Environment

TWiki version: Dec2001
TWiki plugins:  
Server OS: Debian Linux
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- SvenDowideit - 26 Jan 2003

Follow up

Fix record

Sven, thanks for reporting this upstream.

Fixed, in TWikiAlphaRelease and TWiki.org.

-- PeterThoeny - 27 Jan 2003

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2003-01-27 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.