We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Codev Web>FormRenderForEdit (27 Jan 2003, PeterThoeny)
Tags:
create new tag
, view all tags

Bug: Checkbox values not restored when editing a form

See DebianBug:152766

Debian Bug report logs - #152766
twiki: need \Q...\E in TWiki::Form::renderForEdit

version graph

Package: twiki; Maintainer for twiki is Sven Dowideit <svenud@ozemail.com.au>; Source for twiki is twiki.

Reported by: Jonathan H N Chin <jhnc%stone@newton.cam.ac.uk>

Date: Fri, 12 Jul 2002 16:18:01 UTC

Severity: normal

Found in version 20011201-1

Fixed in version twiki/20030201-1

Done: Sven Dowideit <svenud@ozemail.com.au>

Bug is archived. No further changes may be made.

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, eichin@thokPLEASENOSPAM.org (Mark W. Eichin), twiki@packagesPLEASENOSPAM.qa.debian.org:
Bug#152766; Package twiki. Full text and rfc822 format available.


Acknowledgement sent to Jonathan H N Chin <jhnc%stone@newton.cam.ac.uk>:
New Bug report received and forwarded. Copy sent to eichin@thok.org (Mark W. Eichin), twiki@packagesPLEASENOSPAM.qa.debian.org. Full text and rfc822 format available.


Message #5 received at submit@bugsPLEASENOSPAM.debian.org (full text, mbox):

From: Jonathan H N Chin <jhnc%stone@newton.cam.ac.uk>
To: submit@bugs.debian.org
Subject: twiki: need \Q...\E in TWiki::Form::renderForEdit
Date: Fri, 12 Jul 2002 17:11:43 +0100
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




Information forwarded to debian-bugs-dist@lists.debian.org, eichin@thokPLEASENOSPAM.org (Mark W. Eichin), twiki@packagesPLEASENOSPAM.qa.debian.org:
Bug#152766; Package twiki. Full text and rfc822 format available.


Acknowledgement sent to svenud@ozemail.com.au:
Extra info received and forwarded to list. Copy sent to eichin@thok.org (Mark W. Eichin), twiki@packagesPLEASENOSPAM.qa.debian.org. Full text and rfc822 format available.


Message #10 received at 152766@bugsPLEASENOSPAM.debian.org (full text, mbox):

From: Sven Dowideit <svenud@ozemail.com.au>
To: 152766@bugs.debian.org
Subject: i have submited this bug on twiki.org
Date: 26 Jan 2003 12:58:38 +1100
[Message part 1 (text/plain, inline)]
see http://www.twiki.org/cgi-bin/view/Codev/FormRenderForEdit

sven
[signature.asc (application/pgp-signature, inline)]


Reply sent to Sven Dowideit <svenud@ozemail.com.au>:
You have taken responsibility. Full text and rfc822 format available.


Notification sent to Jonathan H N Chin <jhnc%stone@newton.cam.ac.uk>:
Bug acknowledged by developer. Full text and rfc822 format available.


Message #15 received at 152766-close@bugsPLEASENOSPAM.debian.org (full text, mbox):

From: Sven Dowideit <svenud@ozemail.com.au>
To: 152766-close@bugs.debian.org
Subject: Bug#152766: fixed in twiki 20030201-1
Date: Sun, 07 Sep 2003 11:32:22 -0400
Source: twiki
Source-Version: 20030201-1

We believe that the bug you reported is fixed in the latest version of
twiki, which is due to be installed in the Debian FTP archive:

twiki_20030201-1.diff.gz
  to pool/main/t/twiki/twiki_20030201-1.diff.gz
twiki_20030201-1.dsc
  to pool/main/t/twiki/twiki_20030201-1.dsc
twiki_20030201-1_all.deb
  to pool/main/t/twiki/twiki_20030201-1_all.deb
twiki_20030201.orig.tar.gz
  to pool/main/t/twiki/twiki_20030201.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 152766@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sven Dowideit <svenud@ozemail.com.au> (supplier of updated twiki package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----

Format: 1.7
Date: Sun, 27 Aug 2003 00:00:01 -1000
Source: twiki
Binary: twiki
Architecture: source all
Version: 20030201-1
Distribution: unstable
Urgency: low
Maintainer: Sven Dowideit <svenud@ozemail.com.au>
Changed-By: Sven Dowideit <svenud@ozemail.com.au>
Description: 
 twiki      - A Web Based Collaboration Platform
Closes: 149319 151187 151188 152766 153168 153430 163514 165340 169791 171421 171426 171441 171468 177047 183917 190409 192718 199999 200575
Changes: 
 twiki (20030201-1) unstable; urgency=low
 .
   * Changed Maintainership - Mark W. Eichin has no time
   * upgrade to 01Feb2003 release (Bejing) (Closes: #192718)
   * removed the use of twikidat user for now,
     - it causes problems with uploads of attachments and topic edits
     - (Closes: #163514, #165340, #171441, #153430)
   * removed the Alias /twiki line in apache.conf
     - (Closes: #151187, #190409)
   * fixed postrm script (Closes: #171421)
   * added TWikiOnDebian to README.Debian (Closes: #171468)
   * changed the path to grep
     - (Closes: #177047)
   * removed perl-suid dependancy for the moment (Closes: #149319)
   * added dependency for apache2 | apache | apache-ssl (Closes: #171426)
   * switched to gettext for the debconf templates (Closes: #199999)
   * added french translation of the debconf templates (Closes: #200575)
   * seems to fix apt-get --purge remove twiki (Closes: #183917)
   * this has been resolved upstream (Closes: #151188)
   * this has been resolved upstream (Closes: #153168)
   * this has been resolved upstream
     - http://www.twiki.org/cgi-bin/view/Codev/FormRenderForEdit
     - (Closes: #152766)
   * seems to be working now with perl 5.8.0 (Closes: #169791)
Files: 
 5cef82d7262aac9bc5188681abcc5af7 690 web optional twiki_20030201-1.dsc
 cbbd937b51b56c5343b5e72f1be6a0cf 892554 web optional twiki_20030201.orig.tar.gz
 50857c5b0731e8d6cdd3161579aae086 11941 web optional twiki_20030201-1.diff.gz
 0921e438c274a5893d094424aa804b37 882892 web optional twiki_20030201-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iQCVAwUBP1tNND6XMRfcxSjpAQE6DwQAkBRZHUG/2mC4pCeW9PKfru1Owiy9LcAi
frG7ACcry0h1el35+XPZxGLD3BaedH/l3vmQvqeFvr/sCwgDo/73jwGDS5X8b/AZ
JjJG1u2+zW2Zioy2uPke5PvVm9ihqQe2afqWmfCH1Z3qp8jCyl0PuhTRZFTLLatG
HlSZ3lcKCwI=
=ib4w
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Dec 3 23:37:22 2008

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.

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

Topic revision: r2 - 27 Jan 2003 - 00:45:37 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback