Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

Bug: Incorrect category table upgrade to new meta data format

Values of existing category tables are not upgraded correctly to the TWikiForms format. This happens for select, radio and checkbox field types.

Test case

  • Assume you have a form field called ProductVersion of type select, with values Bread 2.0, Bread 2.1, Butter 1.5, Butter 1.6. This is defined in templates/Webname/twikicatitems.tmpl as
    select|ProductVersion|1|Bread 2.0|Bread 2.1|Butter 1.5|Butter 1.6
  • Assume correct upgrade including a WebForm topic defining the form.
  • View a topic that as a category table:
    • Expected: |ProductVersion:|Bread 2.0, Butter 1.6|
    • But has:   |ProductVersion:|Bread 20, Butter 16|

Work around

See fix record

Fix record

Do do: Remove lines 507 and 525 of lib/TWiki/Form.pm of 01 Sep 2001 release.

    if( $cmd[0] eq "select" || $cmd[0] eq "radio") {
        $catname = $cmd[1];
        $scatname = $catname;
        #$scatname =~ s/[^a-zA-Z0-9]//g;
        my $size = $cmd[2];
        for( $i = 3; $i < $len; $i++ ) {
            my $value = $cmd[$i];
            my $svalue = $value;
# remove:   $svalue =~ s/[^a-zA-Z0-9]//g;
            if( $src =~ /$value/ ) {
               $catvalue = "$svalue";
            }
        }

    } elsif( $cmd[0] eq "checkbox" ) {
        $catname = $cmd[1];
        $scatname = $catname;
        #$scatname =~ s/[^a-zA-Z0-9]//g;
        if( $cmd[2] eq "true" || $cmd[2] eq "1" ) {
            $i = $len - 4;
            $catmodifier = 1;
        }
        $itemsPerLine = $cmd[3];
        for( $i = 4; $i < $len; $i++ ) {
            my $value = $cmd[$i];
            my $svalue = $value;
# remove:   $svalue =~ s/[^a-zA-Z0-9]//g;
            if( $src =~ /$value[^a-zA-Z0-9\.]/ ) {
                $catvalue .= ", " if( $catvalue );
                $catvalue .= $svalue;

Environment

TWiki version: 01 Sep 2001
TWiki plugins: N/A
Server OS: N/A
Web server: N/A
Perl version: N/A
Client OS: N/A
Web Browser: N/A

-- PeterThoeny - 20 Sep 2001

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2001-09-29 - JohnTalintyre
 
  • 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.