Bad query string for jqueryFileTreeMediaBrowser

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
11/17/2010 9:23:50 AM
Gravatar
Total Posts 10

Bad query string for jqueryFileTreeMediaBrowser

Hi Joe and everybody,

Mono seems interpret duplicated query string differently than Ms.Net because with this code :

script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "&dir=" + currentDir + "'");

The really query string is ...type=image&dir=&dir%... and apache return empty value for the query string "dir "

In addition, the "&" is inappropriate.

So, the suggested fix is simply remove that is useless :

script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "'");

This code is in Web\Dialog\FileDialog.aspx.cs line 601 in the last sources.

Best regards !

Neil.

11/17/2010 10:28:41 AM
Gravatar
Total Posts 18439

Re: Bad query string for jqueryFileTreeMediaBrowser

Hi Neil,

Sorry but when I change it from &dir= to just &dir= it breaks it on windows with IIS, it causes folders to be duplicated in recursion in the ui.

& is the correct way to encode & in urls in html, it is not always needed in javascript representations of urls but in this case it seems to be needed or it breaks the feature.

Best,

Joe

11/17/2010 2:39:35 PM
Gravatar
Total Posts 10

Re: Bad query string for jqueryFileTreeMediaBrowser

I've just test (with cassini asp.net server under .net 3.5, asp.net 2, windows xp) this :

script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "&toto=null'");

or this

script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "'");

 

It's running perfectly. No need "&" nor "&dir".

I suggest only suppress the "&dir=".

Best,

Neil.

11/18/2010 1:19:33 PM
Gravatar
Total Posts 18439

Re: Bad query string for jqueryFileTreeMediaBrowser

Hi Neil,

Sorry but you are not correct.

Changing that breaks it, if you change &dir= to &dir= it causes folders to be duplicated in recursion so a folder contains itself and its children recursively.

If you remove it altogether like you have suggested in your second post it does not show the sub folders and files.

You have not tested it well enough, if you add folders and sub folders and files you will see how it breaks.

Best,

Joe

11/18/2010 4:44:58 PM
Gravatar
Total Posts 10

Re: Bad query string for jqueryFileTreeMediaBrowser

I don't (but I would like !) understand... I can read from the author of jQuery File Tree :

your script should accept one POST variable (dir)

So, why a query string dir= !??

You can see some screen shots :

With this code : http://neil.pacaeo.com/mojo/FileBrowserCode.png

This POST request when clic on deep child node : http://neil.pacaeo.com/mojo/FileBrowser.png

You can see my added dummy query string "&toto" in order to prove that my code is running. I've correctly tested, isn't it ?

Other infos: tested mojo version is 2-3-4-2 under mono/ubuntu/apache and ms.net/winxp/cassini. The code of Web\Dialog\FileDialog.aspx.cs line 601 is unchanged in the latest version of mojo.

Sorry for this lost time... but on my side, I fix this issue with this solution.

bye !

Neil.

 

11/19/2010 9:17:13 AM
Gravatar
Total Posts 18439

Re: Bad query string for jqueryFileTreeMediaBrowser

sorry but 2.3.4.2 is a very old version, probably there were changes in the jqueryfiletreeservice or other changes that affect this.

If you want to suggest a patch you should work with the latest code.

Best,

Joe

11/20/2010 8:47:27 AM
Gravatar
Total Posts 10

Re: Bad query string for jqueryFileTreeMediaBrowser

...ok, all that you want :

With latest sources of mojo, .Net 4 (and 3.5), latest Asp.net Development server (visual web dev express) (and cassini), windows xp, I've add subfolder : my changment don't break anything and all it's good under mono.

Secondly, the jqueryFileTree  is used  llkj is unchanged since 24 March 2008 (v1.01). Only the ajax script manager has involved. In according to the author, the jqueryFileTree adds only a POST variable. So, are you agree with me that your QUERY string is ignored (therefore useless) (look the queries, it isn't even filled !) ?

Be carefull, I'm talking about FileDialog (in Web\Dialog\FileDialog.aspx.cs at line 601), not about FileService.

Best reagrds

11/20/2010 9:20:36 AM
Gravatar
Total Posts 18439

Re: Bad query string for jqueryFileTreeMediaBrowser

Hi Neil,

We are talking about the same line of code. It works correctly like this:

script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "&dir=" + currentDir + "'");

as shown in this screen shot:

good file dialog

if I change the code like this:

script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "&dir=" + currentDir + "'");

it results in recursive duplicated folders as shown here:

file dialog bad 1

notice how media folder contains itself and if you keep going deeper it keeps duplicating

if I change the code like this:

script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType);

I get no sub folders at all as shown here:

file dialog bad 2

I am testing in VS 2010 on Win7 x64 using .NET 4.0 and IIS7 using CKeditor and the very latest mojoPortal code

If you say it works on Mono and you verify it does not cause those side effects, then I am willing to change the code like this:

#if MONO
            script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType);
#else
            script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "&dir=" + currentDir + "'");
#endif

so it can be compiled differently for Mono

But I am very surprised if it works correctly without passing in the expected parameter for the current directory.

Best,

Joe

11/20/2010 9:25:07 AM
Gravatar
Total Posts 10

Re: Bad query string for jqueryFileTreeMediaBrowser

Please, can you test with the correct code : script.Append(", script: '" + navigationRoot + "/Services/jqueryFileTreeMediaBrowser.ashx?type=" + browserType + "'"); (don't forget the final: + "'") ?

11/20/2010 9:31:15 AM
Gravatar
Total Posts 18439

Re: Bad query string for jqueryFileTreeMediaBrowser

Hi Neil,

doh! My bad, I was leaving off the closing single quote, it does work, I will make this change.

Sorry to be so difficult ;-D

I am glad to have someone testing on Mono.

Best,

Joe

11/20/2010 9:35:06 AM
Gravatar
Total Posts 10

Re: Bad query string for jqueryFileTreeMediaBrowser

I'm very happy ! (and a lot obstinate...)

 

You must sign in to post in the forums. This thread is closed to new posts.