r2 - 29 Sep 2001 - 05:03:57 - JohnTalintyreYou are here: TWiki >  Codev Web > CategoryTableToTWikiFormConversionBug
Tags:
, create new tag

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 | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by TWiki
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 SourceForge.net Logo