Okay, using Groupadmin 2.1. I navigate to the tab to update a user's membership. I get this in the URL:
aaee/og/groupadmin/179/add/4/Paul User?destination=%2Faaee%2Fnode%2F179%2Fgroupadmin
Where "aaee" is the subdirectory where this testbed is installed, 179 is the group's node # and "Paul User" is my fake test account.
When I hit "add" on this page to confirm that I want to add Paul User to a group, I get a "Bad Request" (400 error) from my server. I end up landing at:
aaee//aaee/node/179/groupadmin
Obviously the module is miswriting the destination= value, probably because I'm doing this on a subdirectory installation.
Comments
Comment #1
pbeakley commentedQuick addendum: The function actually did succeed in adding the (fake) user to the group, so it's just the post-function redirect that doesn't work (on a subdirectory installation).
Comment #2
andy inman commentedOk, thanks for that. Yep, the ?destination value is wrong, obviously. I thought I was setting it based on active path, but it seems not. I'll fix it.
Comment #3
andy inman commentedOk, now I've checked, I'm rather mystified why it doesn't work. The destination url is set from request_uri() which should be the current url (before you click the "add" link etc.) In other words you should end up back where you came from. It seems request_uri() is not returning the right value. Is this Apache, and what OS? I'm wondering if its some server configuration thing, because request_uri() ought to work (it's a built-in Drupal function.)
Comment #4
andy inman commentedFurther thought, when you float your mouse pointer over an "add" or "remove" link (etc), is the correct url shown in the browser status bar? The ?destination part should be the current url without the http://example.com part.
Comment #5
pbeakley commentedHey, sorry I'm just now getting back to you on this. This is running on Apache. Not sure how to dig deeper on the server configuration -- is there anything specific about the settings I can look up for you? My apologies for not being more immediately helpful; server stuff is usually beyond me.
I uninstalled Groupadmin and reverted to the built-in tools you get via Group Details block but let me reload it and see what happens.
EDIT: Just reinstalled and gave it a quick runthrough. Unfortunately I can't see what link is in the mouseover because it's the page that is fed when I hit "add," "remove" or "cancel" buttons. Mousing over the buttons doesn't give me a preview of the URL in the status line of my browser. :-/
Comment #6
andy inman commentedCan you somehow display request_uri() - e.g. create a node with the PHP filter and do:
It seems it's not going to include the subdirectory part. The second one might do it correctly (see http://api.drupal.org/api/function/request_uri/6).
I'd like to get this fixed and move on - I've been doing a lot of Drupal module work this week, but need to get back to paid work!
Comment #7
andy inman commentedHmm... further thought - maybe it's me getting it wrong! Wondering if I should be using url() instead...
Please try this:
Comment #8
andy inman commentedOk, forget all the above! I think I've fixed it. Now using the drupal function drupal_get_destination which I think will give you the correct result. Please try replacing your installed .module with this one. If it works I'll make a new release.
Comment #9
andy inman commentedComment #10
pbeakley commentedSweet, thank you! I'll check it out this week.
Thanks for the hard work!
p.
Comment #11
andy inman commentedFixed in 2.2.