• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5845: TSA code in trunk screws up URL parameters like those used in tables

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   major 5.0.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Look at this innocent little table

H1 H2 Correct H2 sort order, da locale
abc def 2
def abc 1
ddf drrt 4
hgy fgy 3

Now look at the URL you get when you mouse over the headers of the table.

Now click on a column to sort it.

On develop.twiki.org the whole thing crashes. That is because warnings are errors.

Try on your own.

You will see that the URL gets longer and longer each time you sort a column and the & becomes entity encoded in the URL.

There is something in the TSA code in trunk that is handling URL parameters all wrong.

Please do not try and fix the plugin. It works fine in 4.2.1 code and 4.2.0 code and 4.1.2 code.

There is something in the core code which is goofed up.

-- TWiki:Main/KennethLavrsen - 29 Jul 2008

I traced the problem and as other TSA problems, I found the root: I need to finish the unit tests ASAP. This particular issue was caused by a misunderstood of mine while reading CGI.pm documentation: TWiki::Request::query_string doesn't guarantee to return query parameters in the same order, but CGI does. I'll concentrate on unit tests, and then I hope to fix (definitely) the problems introduced by buggy TSA code.

However, TWiki:Plugins.TablePlugin handles url parameters with regexes:

    my $plist = $cgi->query_string();
    $plist =~ s/\;/\&/go;
    $plist =~ s/\&?sortcol.*up=[0-9]+\&?//go;
    $plist .= '&' if $plist;
    $url = $cgi->url . $cgi->path_info() . '?' . $plist;
    $url =~ s/\&/\&/go;

This could be done cleanly by something like: (not tested. only to clarify idea)

    $cgi->delete('sortcol', 'table', 'up');
    $url = $cgi->url(-full => 1, -path => 1, -query => 1)
    $url =~ s/\&/\&/go;

Of course, the above regex-code works if CGI semantics is kept.

-- TWiki:Main.GilmarSantosJr - 30 Jul 2008

I'll switch this one to "Waiting for release" after unit tests are finished.

-- TWiki:Main.GilmarSantosJr - 04 Aug 2008

Will your changes still allow this plugin to work with 4.2 and 4.1 of TWiki?

-- TWiki:Main.KennethLavrsen - 04 Aug 2008

I made TWiki::Request behave exactly like CGI.pm: it now preserves parameters order. This change is already checked in and it solved this issue without need to change TablePlugin. I raised (Item5880) a separate report about TablePlugin's problem.

-- TWiki:Main.GilmarSantosJr - 04 Aug 2008

I'm closing this one. I created a separate report (Item5846) for unit tests and linked here.

-- TWiki:Main.GilmarSantosJr - 10 Aug 2008

Changing this from "waiting for release" to "closed" since this is a trunk only bug, e.g. should not be listed in TWiki-5.0.0 release notes.

-- TWiki:Main.PeterThoeny - 29 May 2010

ItemTemplate
Summary TSA code in trunk screws up URL parameters like those used in tables
ReportedBy TWiki:Main.KennethLavrsen
Codebase ~twiki4
SVN Range TWiki-5.0.0, Sun, 27 Jul 2008, build 17148
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:17323
TargetRelease major
ReleasedIn 5.0.0
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r9 - 2010-05-29 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback