I am using the Filedepot module which uses the following URL format to link directly to files:
http:///node/15/filedepot?fid=11
I have the 'Present login form on access denied (403)' feature enabled for LoginToboggin. If a user is not logged in when attempting to access this URL, LoginToboggan's redirect after login sends the user to "http:///node/15/filedepot" cutting off the url a the '?' character.
Is this a bug or a feature? Any ideas for a work around?
Thanks much for any help! -- Kari
Comment | File | Size | Author |
---|---|---|---|
#11 | redirectQueryParameters-2063761-11.patch | 1.57 KB | stevecowie |
#10 | redirectQueryParameters-2063761-10.patch | 1.32 KB | stevecowie |
#9 | logintoboggan-recover-query.patch | 874 bytes | jimyhuang |
Issue fork logintoboggan-2063761
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
dark11star CreditAttribution: dark11star commentedI have a similar problem when a user resets password. Link redirects to /user without any url parameters.
Please let me know if you find a solution.
Thanks,
Jason
Comment #2
johnvb CreditAttribution: johnvb commentedBumping this. I have pages that receive an essential URL parameter to identify an underlying database record, so a URL might look like http://www.example.com/mypage?group_id=10 for example. Using Present login form on access denied (403) works except that the user ends up on http://www.example.com/mypage without the group_id parameter. Inspecting the action on the HTML form element shows it is correct including the group_id parameter so I can't see why this isn't working.
Note that if I disable Logintoboggan and hack a standard login form to change the action attribute to match, everything works nicely. So I think this is a Logintoboggan specific issue.
Comment #3
mudasirweb CreditAttribution: mudasirweb commentedHi,
I am also facing the same issue, I have the redirect url with ?id=cwp attribute the 'id=cwp' attribute, is cut off from the url. Had anyone found the fix.
Comment #4
RedEight CreditAttribution: RedEight at 95Visual commentedI'm experiencing this issue as well... I'm sending users a URL via email with a specific value attached. If they are logged in when they visit the site it works perfectly. If they aren't, they hit the login toboggan login page (with the value intact), but logging in redirects them to the right url sans query parameters.... VERY annoying. I'm not sure why this is happening.
Comment #5
RedEight CreditAttribution: RedEight at 95Visual commentedSteps to reproduce:
{baseurl}/admin/config/system/logintoboggan
.{baseurl}/admin/config/system/logintoboggan?test=me
.Expected Result:
Logged in and viewing the page WITH the query.
{baseurl}/admin/config/system/logintoboggan?test=me
Observed Result:
Logged in and viewing the page WITHOUT the query.
{baseurl}/admin/config/system/logintoboggan
Workaround:
Although I did find one workaround, it isn't pretty. You can url encode the path you need including the query, then add that as a destination query.
Ex:
{baseurl}/admin/config/system/logintoboggan?test=me&destination=admin%2Fconfig%2Fsystem%2Flogintoboggan%3Ftest%3Dme
The problem with this workaround is that a logged in user will not be redirected to the destination after submitting anything on that page... It makes for a confusing experience for logged in users. If that isn't an issue for your use case, then go ahead and give it a try.
Comment #6
RedEight CreditAttribution: RedEight at 95Visual commentedComment #7
RedEight CreditAttribution: RedEight at 95Visual commentedI'm not really sure what to make of the response in the related issue I just added. It seems to me that code should be ensuring that the query string is maintained... And yet, that's apparently why it isn't? drupal_get_destination() appears to specifically preserve the query parameters so they aren't lost... I'm at a complete loss as to why the query strings vanish as soon as I click login... It's even in the form action on the rendered html form...
Comment #8
jimyhuang CreditAttribution: jimyhuang commentedFor those who suffer from this issue, here is the patch to solve this.
In short, drupal core set destination on each not found / access denied before logintoboggan and without query parameter except q.
The patch is to rebuild destination before calling form.
Comment #9
jimyhuang CreditAttribution: jimyhuang commentedComment #10
stevecowie CreditAttribution: stevecowie as a volunteer commentedPatch #9 will do the job, but I think it's probably better do to this as a from submit function. That makes it easier for site builders to see how it's done and potentially override with their own submit function if they need an alternative redirect behaviour. I've marked this for review although I appreciate the issue is old now :-(
Comment #11
stevecowie CreditAttribution: stevecowie as a volunteer commentedTesting showed up a bug in the patch at #10. It screwed up destinations containing a fragment, such as user/login?destination=node/1#comment-form. So, here's a re-rolled version that handles both fragments and query parameters.