Forum OpenACS Development: Strange behaviour of listbuilder / urlencoding / bulkactions

I'm passing the return_url through a sequence of files. All is fine as long as I call the return_url in the URL. But then comes a point where I use an include and suddenly my return_url turns sour:

Original return_url:

/folder?folder_id=19901&task_id=1995

After export_vars:

%2ffolder%3ffolder%5fid%3d19901%26task%5fid%3d21995

After the listbuilder bulk action:

%2Ffolder%3Ffolder_id%3D19901%26amp%3Btask_id%3D21995&party_ids=11438

Note that it turned the & sign (%26) into an $amp;, though urlencoded.

After passing this URL to the include for email sending:

%2Ffolder%3Ffolder_id%3D19901%26amp%3Bamp%3Btask_id%3D21995&party_ids=11438

Note that it doubled the "amp;" part.

Hope someone can explain me how to pass a variable around like this.

Malte, I had a similar problem the other day because I forgot to "noquote" when I passed a return_url to an include. Could it be as simple as that?
Michael, this helped with the doublind of the amp; part. Now I'm still stuck why the bulk action quotes the URL and how I can prevent it from quoting in the first place. I suspect it has something to do with listbuilder using export_vars, but I'm not sure...

I'm away from my desk today so I can't have a proper look, but we have examples of bulk action lists working with return_urls that I had a peek at... They don't urlencode but they do HTML encode, so we get the amp entity in our hidden input values. This doesn't cause a problem though.

So now you are using "noquote" in your include, is your problem with URL encoding or HTML encoding?

After the noquote I get this URL in the final page (after ad_returnredirect $return_url):

/folder?folder_id=19901&task_id=1995

as you can imagine this is something the request processor (ad_page_contract) does not like (well, it does not complaint but for it the variable is called "amp;task_id" not "task_id".

Oops - I think you meant:

/folder?folder_id=19901&task_id=1995

The & is fine if it's in a hidden input (I think maybe the browser decodes it before submitting?) but not OK to use in an ad_returnredirect. But I'm not sure why you're redirecting if you're using the bulk actions... Bulk actions adds a link to the form that calls Javascript that does a form.submit, no?

The page flow is as follows:

- First call folder-chunck.tcl (the one with the bulk actions)
- Folder-chunk runs the bulk action which is /contacts/message
- This page includes /acs-mail-lite/email after running it's own prepage.

At the moment the folder-chunk.tcl listbuilder is the culprit, but I think I have found some solution around it, which basically is not to call the return_url with two values but only one :)