Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
=)
Comment | File | Size | Author |
---|---|---|---|
globalredirect.patch | 2.27 KB | robertDouglass | |
Comments
Comment #1
robertDouglass CreditAttribution: robertDouglass commentedI wanted to avoid the second call to drupal_goto in line 42 but didn't figure out an elegant way to do so.
Comment #2
nicholasThompsonNice patch - I like the idea... Thoughts:
* That patch only causes a lookup for node/123 and not node/123/ - will there ever be a situation where the src WITH slash will be mapped to a destination but NOT the source WITHOUT slash?
* I cant see a much neater way of doing that last two drupal_goto's...
I personally cant see any issue with only doing a no-slash lookup on the source, so I am all for commiting this to the project.
Cheers Rob!
Nick
Comment #3
robertDouglass CreditAttribution: robertDouglass commentedI'm personally not worried at all about not doing a lookup on node/123/. If anyone can think of a case where that is relevant, I'm open to hearing it, but it sounds more like a case where we'd be accommodating something that's broken.
Comment #4
m3avrck CreditAttribution: m3avrck commentedPatch looks great but I have one suggestion:
Couldn't this merely be:
That would be a whole lot faster, eh?
Comment #5
nicholasThompsonFaster, yes. But that function does a fair bit of work.
As I understand it, it checks for arguments other than the 'q' one (for example, page, destination, etc). Without this, users cannot login on the frontpage as it breaks the destination query parameter (eg, node/123?destination=node/124 wouldn't resolve to articles/thingy.html?destination=node/124 as it should. It would lose the destination argument).
Comment #6
robertDouglass CreditAttribution: robertDouglass commentedRTBC?
Comment #7
m3avrck CreditAttribution: m3avrck commentedHmm, yes I see your point. Wondering if something could be refactored somewhere to just look at $_GET[] as a whole, hmm... anyways this patch is a start of something great :-)
Comment #8
nicholasThompsonPatch applied and backported to 4.7. Thanks for your work on this Rob!
Comment #9
killes@www.drop.org CreditAttribution: killes@www.drop.org commented