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.
The Drupal 6 Global Redirect module provides a lot of features like:
- Checks the current URL for an alias and does a 301 redirect to it if it is not being used.
- Checks the current URL for a trailing slash, removes it if present and repeats check 1 with the new request.
- Checks if the current URL is the same as the site_frontpage and redirects to the frontpage if there is a match.
- Checks if the Clean URLs feature is enabled and then checks the current URL is being accessed using the clean method rather than the 'unclean' method.
- Checks access to the URL. If the user does not have access to the path, then no redirects are done. This helps avoid exposing private aliased node's.
- Make sure the case of the URL being accessed is the same as the one set by the author/administrator. For example, if you set the alias "articles/cake-making" to node/123, then the user can access the alias with any combination of case.
This patch aims to add those features (and the ability to configure them) into the Redirect module.
Comment | File | Size | Author |
---|---|---|---|
#284 | interdiff_280-284.txt | 2.57 KB | andralex |
#284 | redirect-d7-1.x-merge_global_redirect-905914-284.patch | 18.93 KB | andralex |
| |||
#280 | redirect-d7-1.x-merge_global_redirect-905914-280.patch | 18.82 KB | jedsaet |
| |||
#278 | redirect-d7-1.x-merge_global_redirect-905914-278.patch | 18.51 KB | c7bamford |
| |||
#258 | interdiff.txt | 3.54 KB | tomsegarra |
Comments
Comment #1
Dave ReidHrm, you can describe more about what's going wrong? I can't duplicate this currently.
Comment #2
Dave ReidNo response in over a month, so marking as fixed.
Comment #4
Azol CreditAttribution: Azol commentedHey, I got the same issue.
I enter URLs to redirect from and redirect to and press "Save".
I got moved immediately to correct redirect page (the one in Redirect To field) but when I go back to the URL Redirects page I can see no redirect entries at all. The list is empty.
Comment #5
Dave ReidI still cannot duplicate this. Can you please post the details on the redirect you were trying to save?
Comment #6
Azol CreditAttribution: Azol commentedRedirect From = relative old path, pointing to a non-existent page, a remnant of an old site, for example:
texts/text.html
Redirect To = relative path to actual page, for example:
articles/text
When I press Save, I got redirected immediately to articles/text page (instead of staying in URL Redirects settings page).
If I move back to admin/config/search/redirect, I cannot see any entries. The redirect table in site DB is empty as well.
I do not have Global redirect or Path redirect modules installed.
Comment #7
Azol CreditAttribution: Azol commentedOk, I got it figured out.
You cannot create URL Redirect if the Redirect To path is a synonym OR has a synonym defined.
You won't receive any warning about that, you just got moved silently to the target web page.
Comment #8
Azol CreditAttribution: Azol commentedFurther info:
the problem is with
part of the code (redirect.admin.inc, line 363). When drupal_get_normal_path got invoked, it receives a "normalized", i.e. "non-synonym" path as a $value.
Then drupal_get_normal_path itself performs a hook_url_inbound_alter(), so Redirect module receives the priority again and redirects us to the "synonym" page asap.
It means the code after line 363 is never get executed IF the path has a synonym defined.
Comment #9
bdunwood CreditAttribution: bdunwood commentedsub
Comment #10
sylv3st3r CreditAttribution: sylv3st3r commentedCan someone confirm that this patch : http://drupal.org/node/944120 resolve this issue? I haven't tried it since redirect module breaks my cron.
Comment #11
Azol CreditAttribution: Azol commentedNo, that patch does not fix this issue.
I have tested the last dev. version with that patch incorporated, but the reason of this erroneous behaviour I have already explained in the above posts.
Actually escalating this to Critical, because the main function of the module is broken - and I think like 90% of the sites use path aliases.
I will give it a good debugging again when time allows and MAYBE I will be able to come up with the solution. Still, want to hear from Dave if he was able to reproduce this issue.
Comment #12
Dave ReidYeah I confirmed this. I'll have to disable the global redirection functionality temporarily until I can figure out a solution.
Comment #13
markdorisonI am experiencing this issue as well.
Comment #14
amanaplan CreditAttribution: amanaplan commentedsubscribing
Comment #15
Dave ReidI just committed the temporary disabling of global redirection until I can work out a better solution. It may have to wait until after 7.0 release.
Comment #16
Azol CreditAttribution: Azol commentedPlease, take a quick look at this part of code (redirect.admin.inc, line 356 onwards):
I have disabled these two lines of code and everything seems to be working as designed.
The reason to disable the drupal_get_normal_path call is this: you have already called _redirect_extract_url_options (line 358), which performs drupal_get_normal_path all right (line 404), so the $value (line 359) contains normalized path. When you call drupal_get_normal_path for the second time, you got redirected immediately via hook call because you are not supposed to pass normalized paths to drupal_get_normal_path function!
So I would just roll back the last change (enabling global redirect again) and change just these two lines (commenting or deleting them) to fix this issue. Works perfectly for me. At least I can not see any possible flaws in this solution.
P.S. Plus one more minor fix: line 378
should not contain a space between "&" and "$" symbols.
Comment #17
Dave ReidChanging scope and priority
Comment #18
swentel CreditAttribution: swentel commentedHere's a patch that
a) does what Azol describes in #16
b) renables the global redirect functionality. I also had to change the $redirect variable to a stdClass instead of an array because that gave a lot of notices
Global redirect seems to be working fine now (so node/1 to 'a-nice-alias') and managing redirects in the admin too.
Comment #19
swentel CreditAttribution: swentel commentedNeeds work, still have the problem of editing an existing alias, the value never gets saved, will look into it in a few moments.
Comment #20
swentel CreditAttribution: swentel commentedOk temporarily a patch which makes editing redirects or aliases work. Removing the code as suggested in #16 is not a solution, so that code is back in. Path.admin.inc also calls drupal_get_normal_path() in its validate function so you get redirected when editing url aliases.
I've added (a very ugly) check in redirect_url_inbound_alter() checking on arg(2) and arg(3) for 'config' and 'redirect' or 'path'. This works for now so we can edit which is good, however, this can never be RTBC.
I think we should find another way than using redirect_url_inbound_alter() because as soon as someone calls drupal_get_normal_path() you might get redirected without knowing what's going on. @Dave Reid If you have suggestions, add some comments or ping me on IRC, I'd be happy to try and test other things out for this patch.
Comment #21
Azol CreditAttribution: Azol commentedWhat setup do you have? #16 worked for me so far...
Comment #22
swentel CreditAttribution: swentel commentedAzol, try editing an existing URL alias (at admin/config/search/path), you'll be redirected too and no save.
Comment #23
Kiphaas7 CreditAttribution: Kiphaas7 commentedsub
Comment #24
BenK CreditAttribution: BenK commentedSubscribing
Comment #25
Docc CreditAttribution: Docc commentedsub
Comment #26
pillarsdotnet CreditAttribution: pillarsdotnet commentedPatch from #20, corrected, simplified, and also avoids redirecting from cron.php, xmlrpc.php, update.php, etc.
EDIT: Also filed bug against core: #1217668: drupal_path_initialize() should not call drupal_get_normal_path() when run from cron.php.
Comment #27
pillarsdotnet CreditAttribution: pillarsdotnet commentedAdditional fix to avoid php 5.3 errors from implicitly casting an array to an object.
Comment #29
pillarsdotnet CreditAttribution: pillarsdotnet commentedTrying again, with the correct patch file this time.
Comment #30
amanaplan CreditAttribution: amanaplan commentedRe-rolling patch from #30, removing extra tabs/spaces from two line endings.
Comment #31
pillarsdotnet CreditAttribution: pillarsdotnet commentedRevised patch also prevents the redirect from running under drush and other CLI applications.
Comment #32
pillarsdotnet CreditAttribution: pillarsdotnet commentedImproved patch re-enables the relevant admin settings and also leverages the existing redirect_can_redirect() function.
Comment #33
joelstein CreditAttribution: joelstein commentedI patched with #32, but got the following error when visiting /index.php:
Recoverable fatal error: Argument 1 passed to redirect_object_prepare() must be an instance of stdClass, array given, called in drupal/sites/all/modules/redirect/redirect.module on line 930 and defined in redirect_object_prepare() (line 649 of drupal/sites/all/modules/redirect/redirect.module).
Comment #34
pillarsdotnet CreditAttribution: pillarsdotnet commentedUpdated patch.
Comment #36
pillarsdotnet CreditAttribution: pillarsdotnet commentedFixed typo.
Comment #38
pillarsdotnet CreditAttribution: pillarsdotnet commentedTrying again...
Comment #39
pillarsdotnet CreditAttribution: pillarsdotnet commented(sigh) I'll get it right eventually...
Comment #40
DamienMcKennaI don't think it's quite working the way intended.
Does what I'm experiencing mean that the issue needs to go back to "Needs work", or that I need to submit a new issue?
Comment #41
DamienMcKennaReviewing the configuration I realized that this was a new feature, so I added a new issue: #1255998: Option to redirect to the site root directory if the path == site_frontpage
Comment #42
DamienMcKennaDaveReid, what re-engineering were you intending before re-adding this functionality?
Comment #43
klausiWorks for me. I'm not that experienced with this module, so I don't want to set this to RTBC. Anyone else?
Comment #44
grendzy CreditAttribution: grendzy commentedComment #45
pillarsdotnet CreditAttribution: pillarsdotnet commented#39: redirect-restore-global-redirect-905914-39.patch queued for re-testing.
Comment #46
lliss CreditAttribution: lliss commentedargs() is being crushed by hook_url_inbound_alter which means any code that relies on it is falling down. My fix is just to totally remove redirect_url_inbound_alter. I'm going to roll with this until something better comes along.
Comment #47
pillarsdotnet CreditAttribution: pillarsdotnet commentedPlease cite a reference or otherwise support your assertion. I see nothing in the code you remove that changes the output of the
arg()
function.Furthermore, you are hijacking this issue with an unrelated patch which has nothing to do with the problem and fix addressed by this issue. Please open a separate issue, instead.
Re-uploading the working patch which is currently under review.
Comment #48
Dave ReidComment #49
pillarsdotnet CreditAttribution: pillarsdotnet commented#47: redirect-restore-global-redirect-905914-39.patch queued for re-testing.
Comment #50
DamienMcKennaAnyone else running into problems with canonical URL support clashing with the pager and throwing the browser into an infinite loop?
Comment #51
pillarsdotnet CreditAttribution: pillarsdotnet commented@DamienMcKenna -- Please describe how to reproduce this error so we can write a test case and fix it.
Comment #52
jenlamptonI'm not really sure what I am reviewing here, I was hoping this patch would add the functionality of global_redirect module into redirect, but after testing I think maybe that's not the case - so I'm leaving as needs review.
Results of testing: navigating to node/15 did not gently redirect me to the drupal_get_path_alias() version of the path. My page still loads and the URL says node/15. Similarly, navigating to index.php?q=node/15 also did not redirect to the clean-urls version of the path :(
For now, I'm still going to use both modules, but it would ne nice if we could get all the old D6 redirect modules into Redirect :)
Comment #53
DamienMcKenna@pillarsdotnet: I'm using a Panels node view for the content type, on the node I have a view with a pager, clicking on any page in the pages list should go to e.g. /mypage/page/1/0 but instead is redirected back to /mypage. I haven't dug into it too much, but disabling the "redirect canonical URL" option fixes it.
Comment #54
DamienMcKenna@jenlampton: Did you enable the "redirect canonical URL" option? What options did you enable in the Redirect settings page?
Comment #55
jenlampton@DamienMcKenna I am running the dev snapshot from Dec 2, and *thought* I had applied this patch. It appears 'git apply' didn't work at all for me, and after you asked me if I'd turned on canonical redirection, I realised that I'd never even seen that option! :) a patch -p1 did the trick for me this time, but bad news...
With the following settings, I get this error when visiting index.php?q=node/15:
Redirect from paths like index.php and /node to the root directory. (Checked)
Redirect from non-clean URLs to clean URLs. (Checked)
Redirect from non-canonical URLs to the canonical URLs. (Checked)
Remove trailing slashes from paths. (Checked)
Allow redirections on admin paths. (Un-Checked)
Comment #56
rickvug CreditAttribution: rickvug commentedThe last patch was not applying for me. Attached is a re-roll. I've yet to test the actual workings of the patch.
Comment #57
jenlamptonWorking on the patch from #56 (which applies cleanly) :)
- changing pathauto "patterns" and re-saving node with pathautp checkbox checked redirects.
- changing node title and re-saving node redirects.
- visiting the Drupal system path for the node (node/1) redirects.
- visting non-clean url (?q=node/1) redirects.
- visiting actual full url (index.php?q=node/1) also redirects
- visiting any one of the paths above with a trailing slash, redirects.
- visiting the Drupal system path with a query string (node/1?foo=bar)redirects, retaining the query string.
Anything else I should be testing? test bot?
Comment #58
DamienMcKenna@jenlampton: did you try a pager? E.g. attach a view to a page and have sufficient records in the view that it makes a pager display, the URLs will be in the form /clean/url/page/0/1 but they all redirect back to /clean/url.
Comment #59
jenlamptonA page-view pager seems to be in the format pager-test?page=1. A block-view pager also adds a query string articles/test-article?page=4.
... still not sure where the redirects come in for views.
But Test bot likes it :)
Comment #60
jantoine CreditAttribution: jantoine commented#1255998: Option to redirect to the site root directory if the path == site_frontpage
Given that the issue above has been marked a duplicate of this issue, I imagine that after applying this patch, the path I have specified as my front page should be redirected to the to the sites base URL, but this is not the case.
Steps to reproduce:
Comment #61
batigol CreditAttribution: batigol commentedSo in other words with this patch Redirect module should be replace for Global Redirect module ?
Comment #62
jenlamptonI'm running into the same problem with front page, but all other redirections are working. Changing status.
@batigol, yes :)
Comment #63
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedI have added global home page redirect for both clean and "dirty" URLs for AntoineSolutions and myself.
It's reworked patch from #56 and it should do all things from #57 and a bit more
* example.com/index.php?foo=bar&q=node/123 -> example.com/node/123?foo=bar
* example.com/index.php?q=node/123&foo=bar -> example.com/node/123?foo=bar
* example.com/index.ph?q=node -> example.com/ (if "node" is home page)
* example.com/node -> example.com/
Comment #65
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedpatch fixed (i hope)
Comment #66
pwiniacki CreditAttribution: pwiniacki commentedI don't use front page on my site so I can't test it. But it seems to work fine on my friend page.
However do I need to install Global Redirect in addition to this module ? Does redirect works the same way or there are some differences ?
Comment #67
pillarsdotnet CreditAttribution: pillarsdotnet commented@pwinlacki -- With the patch, the Redirect module should do everything that Global Redirect does, and more.
Comment #68
batigol CreditAttribution: batigol commentedPillarsdotnet thank you for clearing this out. I can't wait till beta5/rc1 release !
Comment #69
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedI would note one specific thing: You should not set alias (welcome) for front-page path (node/1). If you do this redirect will send you to front page's alias (http://example.com/welcome) if you type site URL (http://example.com)
Is this a bug to resolve?
Comment #70
pillarsdotnet CreditAttribution: pillarsdotnet commented@fasdalf@fasdalf.ru -- You should not RTBC your own patch. Also,
Yuck! Isn't there anything in the Drupal API to accomplish this?
Comment #71
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedNew patch checks if requested page is front and skips redirect to alias.
Comment #73
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedPatch rebuilt
Comment #75
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedComment #77
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedSorry. Can't figure out what it's don't like. Attach is new version of home/front page feature.
Comment #78
jenlamptonAfter I figured out what you changed in the patch file, I applied the same changes to my own copy of redirect. I do not see the site redirecting from 'welcome' to the front page with no path (to use your example).
Trying a new approach.
Comment #80
jenlamptonHm, I'm not sure why that test failed.
I disabled cleanURLs and un-checked the cleanURL redirect checkbox, and my site redirects from ?q=redirect to ?q=node just fine.
Rerolled with one other minor bug fixed, but if the test needs to be rewritten I may need some help with that.
Comment #82
valor CreditAttribution: valor commentedComment #84
fasdalf@fasdalf.ru CreditAttribution: fasdalf@fasdalf.ru commentedIMHO there is a problem with this code
It will make endless redirect. I believe it should be like this:
Comment #85
DamienMcKenna@fasdalf: I believe you meant:
Comment #86
pillarsdotnet CreditAttribution: pillarsdotnet commentedAlso see http://drupal.org/node/1183208
Comment #87
klaasvw CreditAttribution: klaasvw commentedThis is slightly related. The stub for implementing global redirect functionality is causing problems with some modules: #1463010: Entity_load during url_inbound_alter is incompatible with text fields
Comment #88
jenlamptonin response to #85,
isset($_GET['q']))
doesn't prevent the infinite redirect on the home page either. Would love suggestions as to how to get that working.Comment #89
jenlamptonOkay, here I tried to determine if we were on the front page already by comparing $_SERVER['REQUEST_URI'] to base_path().
Also trying a new approach, this time with the redirect firing in hook_url_inbound_alter instead of in hook_init.
Comment #91
jenlamptonand one more time sans dsm.
dunno why tests are failing, but maybe someone else can help with that?
Comment #93
Alan D. CreditAttribution: Alan D. commentedPlease note that calling entity_load() can break things if done before menu_get_custom_theme().
See #1370964: Redirect interferes with hook_custom_theme for details.
Comment #94
pfournier CreditAttribution: pfournier commentedThis patch results in infinite redirections when Persistent URL (purl) module is installed. Investigating.
Comment #95
pfournier CreditAttribution: pfournier commentedDoing a redirect from hook_url_inbound_alter is not right; this hook is called from drupal_get_normal_path(), and callers of drupal_get_normal_path() certainly do not expect a redirect to be done.
IMHO all redirects should be done in hook_init().
Comment #96
barraponto CreditAttribution: barraponto commented#91: enable_global_redirections_with_frontpage-905914-91.patch queued for re-testing.
Comment #98
barraponto CreditAttribution: barraponto commentedOk, so the errors are because the test expects the user to be redirected to the actual redirect url, but it might (should) redirect to the frontpage (no internal path) if the redirect url is actually the frontpage. So I guess we have to fix the test.
There's some logic already available at redirect_url_inbou'nd_alter checking for the redirect_global_home variable. And I don't think it should default to TRUE, since that wasn't the behaviour before. I'm just changing that and hoping it fixes the tests until we improve them.
Comment #99
DamienMcKennaMarked #1793330: Global redirect feature is not working at all as a duplicate.
Comment #100
pillarsdotnet CreditAttribution: pillarsdotnet commentedRe-rolled against current 7.x-1.x checkout.
Comment #102
pillarsdotnet CreditAttribution: pillarsdotnet commentedMissed a closing brace; sorry.
Comment #104
pillarsdotnet CreditAttribution: pillarsdotnet commentedNot sure whether the static is supposed to store a single redirect or an array as returned from (e.g.) redirect_load_by_source().
Going with the latter for now...
Comment #105
pillarsdotnet CreditAttribution: pillarsdotnet commentedComment #106
jenlamptonPatch works great for me!
Comment #107
jenlamptonRemoved whitespace errors too.
Comment #108
wizonesolutionsCan someone update the issue summary? The patch is RTBC and passing tests, but I don't remember what it's supposed to do. At a camp this weekend so might have time to commit this.
Comment #109
barraponto CreditAttribution: barraponto commentedTagging.
Comment #110
gregglesI tried to update the issue summary based on reading many of the comments here (and skimming some). I didn't review the code.
Comment #111
gregglesreverting unintentional de-tagging...
Comment #112
jenlamptonUpdate: Patch still applies cleanly, and still works :)
Comment #113
wiifmHaving got rid of the module globalredirect recently and added redirect, I did miss the functionality that globalredirect provided around sending 'node/1234' => path_alias.
I applied this patch to 7.x-1.x-dev, and it mostly seemed fine. The only major issue is that the homepage no longer is accessible on '/', as it redirects to 'home' (the path alias for node/1). This some how causes panels selection criteria to break (page is the site front page).
Obviously there is some work around the homepage that needs to be completed before this is ready to go.
I started altering the patch, and then worked out it would probably be easier if I merely implemented hook_init() myself and do the redirect for node/1234 => path_alias
Comment #114
pillarsdotnet CreditAttribution: pillarsdotnet commentedOne of the reasons for implementing global redirect is to avoid having two urls point to the same content. If the
example.com
front page is set tohome
which is an alias fornode/1
then exactly one of the two rules should be enforced:http://example.com/node/1
orhttp://example.com/
... should redirect to
http://example.com/home
http://example.com/node/1
orhttp://example.com/home
... should redirect to
http://example.com/
Do your panels selection criteria only break when rule #1 is active, or do they also break when visiting
http://example.com/node/1
orhttp://example.com/home
directly? If the latter, then I'd say you have identified a bug in panels, not in the redirect module.Comment #115
pillarsdotnet CreditAttribution: pillarsdotnet commentedComment #116
wiifmWhen I had the globalredirect module enabled,
node/1
would go to '/
' which was perfect as it was the homepage.With this patch applied, this is what happened:
1) Visit '
/
', redirected to '/home
', panels selection criteria fail2) Visit '
/node/1
'. redirected to '/home
', panels selection criteria failI don't know if it makes any difference, but the site I am working on is multilingual as well (so there is indeed two site_frontpage)
Comment #117
barraponto CreditAttribution: barraponto commented@pillarsdotnet i think the expected result is option #2: both node/1 and /home should redirect to /
I think that's what @wiifm says in #116 and that's what I'd expect as well. I think (from #98) that there's a variable (
redirect_global_home
) and a test for that.Comment #118
jenlamptonI'm putting this patch on yet another site, here is what I did:
1) enable redirect module (dev version, with patch applied)
2) go to redirect settings page to enable 'global redirect' functionalty
3) enable the setting "Redirect from paths like index.php and /node to the root directory."
And here are my tests:
Navigate to the home page '/' - expect no redirection. Works as expected.
Navigate to my panel for use on the front page '/frontpage' - expect redirect to '/' - Works as expected.
Comment #119
jenlamptonchanging status, I have a feeling you just forgot to check the box to turn on the home page redirect feature. I can't get it to misbehave. :)
Comment #120
Alan D. CreditAttribution: Alan D. commentedReroll.
Minor change
and
Comment #121
Alan D. CreditAttribution: Alan D. commentedAnother style error :(
However, this doesn't completely work as expected for pages with aliases.
Enable Path & Redirect
Create a node and set alias to home
Check redirect_global_home
Set Site Information Default front page to home
node/1 redirects to home
Set Site Information Default front page to node/1
node/1 redirects to home
A quick look shows that on /home, $_GET['q'] is set to the alias when drupal_is_front_page() is called.
No time to investigate further, but the quickest workaround I saw was to remove the alias, and to use Page manager / Panels to embed the node on a custom page with the URL home and setting this as the default front page in the site Information settings.
Comment #122
gregglesI notice that this patch includes new functionality, but doesn't include any tests.
The discussion in #117/119 makes it clear that some tests could be helpful to be more confident that the functionality works as expected.
Comment #123
Alan D. CreditAttribution: Alan D. commentedChanging status as per Greg's comment and issue related to path aliases noted in #116 & #121.
Comment #124
ericras CreditAttribution: ericras commentedThe functionality I'm looking for is the "Deslash" setting from Global Redirect that 301's a request for about-us/ to about-us
I've applied #121 to latest dev of Redirect and it looks like the setting redirect_global_deslash (Remove trailing slashes from paths) doesn't Deslash anything and the setting isn't being referenced anywhere.
Comment #125
mrweiner CreditAttribution: mrweiner commentedThe work being done here is great, and is moving in the right direction. Although it does what it is supposed to, I've discovered a conflict that it produces. I am using the Video Embed Field module to display youtube videos in a colorbox on my site. With the latest version of the patch applied, a $variables array created by Video Embed Field is not populated correctly when using a colorbox to load the video. As a result, the video does not display. I originally opened an issue over there at #1908058: $variables array not being built correctly when using colorbox..
Not sure where the conflict is exactly, but I figured I should point it out. Let me know if you need more clarification.
Comment #126
acbramley CreditAttribution: acbramley commentedOnly thing holding me back from making the jump to this module is the entity id url -> alias redirection. IMO that is one of the best features of globalredirect, but I need my clients to have an admin interface for redirects. Any ideas of when this feature will come in?
Comment #127
Gastonia CreditAttribution: Gastonia commentedAfter reading this post as well as several others in the queues about the differences between Global Redirect and Redirect, I too am confused as to a few things. First, Obviously we want the functionality of cleaning up duplicate content that Global Redirect provided.
Also, in Pathauto config screen under settings recommends using the "Redirect" module when "leaving old aliases intact when generating new aliases." Which, is of course what I want as I am about to do a massive url structure rewrite and want redirects from the old aliases.
So, Can I use both Global Redirect and Redirect despite the effort of merging the former into the latter? Are their conflicts?
Secondly, as of the patch and few comments above, this still needs testing and people are finding minor bugs.
So then, what is the stable solution? Do / Can I use both Global Redirect and Redirect together? Or is the merging functionality stable enough that it has made GR obsolete, and I can happily get rid of it and use just Redirect as the complete solution?
Thanks!
Comment #128
acbramley CreditAttribution: acbramley commentedI'm currently running an older dev release of Redirect that contains the alias redirecting from the system paths which I needed. I disabled globalredirect and enabled that and it works a treat. I don't think it'd be a good idea to run the 2 side by side though.
Comment #129
ericras CreditAttribution: ericras commentedHere's where I'm at working on #121:
* Got Deslash (Remove trailing slashes from paths) working.
New features:
* redirect_global_index setting to remove 'index.php' from non-front paths.
* redirect_global_canonical_front setting to indicate if you want the front page to redirect to its canonical URL. I found that with the existing redirect_global_canonical setting, a request for the root "/" would redirect to "/welcome-to-my-site" because that is the front page canonical URL. That's undesired behavior in most cases.
I've tested this with pathauto and subpathauto with success. Obviously it still lacks test cases.
The big structure question I have is should this global behavior reside in redirect_url_inbound_alter() or redirect_init()? I basically left it as it was - calls to redirect_redirect() split between the two. I'm guessing redirect_url_inbound_alter() should only contain calls to redirect_set_current_redirect() and no calls to redirect_redirect() so that other modules can still execute their hook_url_inbound_alter(). Then redirect_init() can use redirect_get_current_redirect() and do the redirect.
Comment #130
ericras CreditAttribution: ericras commentedHere is #129 + Add Slash functionality for use with the Trailing Slash module to enforce trailing slashes.
Comment #131
Juan C CreditAttribution: Juan C commentedI used #130 for a week, works for me so far. Thanks.
Comment #132
gregglesDoes this need anything other than tests?
Comment #133
unleet CreditAttribution: unleet commentedPatch #130 is giving me redirect loops with the "Redirect from non-canonical URLs to the canonical URLs" option turned on.
Comment #134
unleet CreditAttribution: unleet commentedComment #135
Corwin CreditAttribution: Corwin commentedHow do you redirect from sub.domain.com to domain.com/sub ?
Comment #136
jenlamptonI'm also getting the following error when I have a view on my home page with a pager, and I click any of the pager links:
I don't have any redirects set up for my home page, but it is a panel that's set up at /front. If I UNcheck the box for Redirect alternative front page URLs to the root directory, then everything behaves properly.
Comment #137
candelas CreditAttribution: candelas commentedany news on redirects? thanks for your hard work :)
Comment #138
batigol CreditAttribution: batigol commentedI guess nobody is working at it at the moment. All focus is on Drupal 8.
Comment #139
acbramley CreditAttribution: acbramley commented@Corwin I believe that sub domain redirects need to be done at a webserver level rather than through Drupal.
Comment #140
PlayfulWolf CreditAttribution: PlayfulWolf commented@acbramley there is always the case when webmaster has limited access to webserver configuration - so it may be an option in some Drupal module, but now I am thinking, if it is even possible...
Comment #141
j0rd CreditAttribution: j0rd commentedWhat features does redirect currently have, in the stable release which are from global redirect, which were not included previously in the D6 path_redirect module?
For me, the "basic" functionality of global_redirect was two things, removing trailing slash and redirecting node/123 to path alias. It appears the stable version of redirect currently does neither of these.
Because of this, I would recommend changing the description of this project because it's confusing for an experienced user of Drupal, who have used the previous modules this module claims to replace. For inexperienced users, I assume it would be worse.
I would recommend stating what features the stable version provides (or dev) from Global Redirect, and which features it does not implement. Then I would recommend linking to this patch and including what features this patch includes from Global Redirect, which work (and link to a specific patch version).
Perhaps this would get more people in here testing and moving this forward. This patch issue has been ongoing for 3 years now.
--
This is just my experience from reading over the description of this module, thinking to myself, awesome I don't need global redirect...only to find out I still do.
Comment #142
colanMoving this up in priority, just in case it helps. ;)
Comment #143
subhojit777#121 and #129 patches not working. I am getting infinite loop messages in certain pages.
Comment #144
batigol CreditAttribution: batigol commentedI have tested it again, and there are still problems. Installing DA and i18n give me loops almost all the time but i guess integration with those module will be add later on.
Comment #144.0
batigol CreditAttribution: batigol commentedattempting to update the summary
Comment #145
ericras CreditAttribution: ericras commentedHere's an update that should correct the redirect issue described in #136, #143, etc. I was not accounting for query strings.
The big outstanding thing is tests.
I've been using this in production successfully since March. The one minor bump in the road for me has been using it on a site that is behind an Apache ProxyPass setup; redirect_can_redirect() returns false since $_SERVER['SCRIPT_NAME'] != $GLOBALS['base_path'] . 'index.php'
Comment #146
oadaeh CreditAttribution: oadaeh commentedSetting to Needs review so the testbot will test the most recent patch.
Comment #147
jenlamptonI'm marking this issue RTBC since the patch in #145 is working great for me. If tests are needed before this can be committed feel free to push back, but I'd love to get this in sooner rather than later. Almost all my sites are using one version of this patch or another ;)
Comment #148
ezeedub CreditAttribution: ezeedub commentedI just ran into an infinite redirect loop on a multilingual site for the case where the redirect_global_home = 1, and then visiting http://example.com/en.
I believe globalredirect used to deal with this (as well as redirecting http://example.com to http://example.com/en). I'm sorry I don't have time to provide a patch right now, but am currently accounting for this in hook_redirect_alter().
Comment #149
kalabro@ezeedub, have you applied patch from this issue first #1796596: Fix and prevent circular redirects?
Comment #150
kalabro@ezeedub, I restore this issue status.
Comment #151
candelas CreditAttribution: candelas commentedkalabro, do you recomend to apply patch #146 on https://drupal.org/comment/8506117#comment-8506117 and then this. there is no conflict? sorry, i am learning about patches and if they run on the same dev, won't they interference? thanks :)
Comment #152
kalabro@candelas, I've applied both on my local environment and after testing deployed to live website.
Comment #153
candelas CreditAttribution: candelas commentedthanks kalabro. I have installed it and until know it looks ok. i will report if i have any problem :)
Comment #154
ezeedub CreditAttribution: ezeedub commented@kalabro You are right, I had not applied that other patch. I was confused about whether this issue superseded that one or not. Applying fixes the issue I mentioned in #148.
However, I got to that issue via another. Using globalredirect, paths such as /user were redirecting to /en/user. I switched to redirect though because of the infinite looping issue. Which brought me here (in addition to the other issue you just referenced).
So, long story short... I've tracked what I think we really need, and that is to re-add the globalredirect functionality of prepending the language prefix.
Comment #155
ezeedub CreditAttribution: ezeedub commentedHere's another try which handles language prefixes better.
Comment #157
ezeedub CreditAttribution: ezeedub commentedArgh, add new language prefix to redirect_variables()...
Comment #159
ezeedub CreditAttribution: ezeedub commented157: redirect-global-905914-157.patch queued for re-testing.
Comment #161
ezeedub CreditAttribution: ezeedub commentedAdd test for locale in redirect_redirect()...
Comment #162
jasonlttl CreditAttribution: jasonlttl commentedI think there may be a problem in #161 with language.inc being conditionally loaded independent of whether or not the locale module is enabled.
Specifically, I'm getting...
Fatal error: Call to undefined function language_url_split_prefix() in [snip]/redirect/redirect.module on line 1125
I actually have a few other patches applied so for me that's here.
There's a long issue in pathologic regarding a similar problem.
https://drupal.org/node/1848554
Their solution was to do this...
If I look at locale.module, I see that file being included on demand a lot so it seems like module_exists is probably not quite enough.
Comment #163
jasonlttl CreditAttribution: jasonlttl commentedAttached is a patch that adds a require for the language.inc
Comment #164
jasonlttl CreditAttribution: jasonlttl commentedComment #165
shahinam CreditAttribution: shahinam commentedThere is redirect loop for "Redirect from non-canonical URLs to the canonical URLs"
Clean URLS are also getting redirected and enters redirect loop - which is finally detected and stopped
inside redirect_redirect()
Disabling "Redirect from non-canonical URLs to the canonical URLs" from settings,
"Redirect from non-clean URLs to clean URLs" then has no effect and does not redirect no-clean to clean.
Comment #166
beeradb CreditAttribution: beeradb commentedAttached patch is based on #161 and adds whitelist support to the language redirect option.
Comment #167
Honza Pobořil CreditAttribution: Honza Pobořil commentedIt is quite hard to understand this issue status. What blocks commiting of finished features? What features are not finished yet?
I think this information should be in the issue summary for issues long like this.
Comment #168
jenlamptonchanging status for testbot.
Comment #170
jessehsThis is a reroll of 166 to apply to 7.x-1.x-dev. The only difference is the removal of the one failing hunk. As far as I can tell, this was fixed a different way in dev.
Comment #171
jessehsSame as patch in 170, except a variable was given the wrong default value (causing weirdness for front page paths). See interdiff.
Now, given the following 3 nodes with the following aliases:
node/1 => foo
node/2 => bar
node/3 => home (set as site home page)
Enable the module. Visiting all paths now redirect to their aliases.
Edit: the 'node/3' path now redirects to '/' (home).
When the "Redirect the front page to its canonical URL" is checked, www.example.com/node/3 is directed to "home" AND www.example.com/ is also directed to "home".
Comment #172
B-Prod CreditAttribution: B-Prod commented@jessehs: your patch does not take care of #162, so it does not work on multilingual sites.
Comment #173
colanChanging status based on #172.
Comment #174
vadym.kononenko CreditAttribution: vadym.kononenko commentedAdded #162 require_once() to #171
Comment #175
barraponto CreditAttribution: barraponto commentedComment #176
Dave ReidComment #177
DamienMcKennaFixed a small typo in the issue summary, an open LI was missing.
Comment #178
krisahil CreditAttribution: krisahil commentedRe-rolled patch from #174 against latest 7.x-1.x (7.x-1.0-rc1+13-dev).
Comment #179
deanflory CreditAttribution: deanflory commentedPatch #178 FAILS when applied to the latest dev (2015-Jan-05).
Comment #180
hass CreditAttribution: hass commentedComment #181
gregglesApplied fine to the tip of the 7.x-1.x branch for me using either "git apply merge-globalredirect--905914-178.patch" or "patch -p1 < merge-globalredirect--905914-178.patch"
Comment #182
deanflory CreditAttribution: deanflory commentedTried again and got the same error with Mac OS Terminal with these:
patch < merge-globalredirect--905914-178.patch
AND
patch -p1 < merge-globalredirect--905914-178.patch
Comment #183
colanBoth "git apply" and "patch" commands worked for me, latest 7.x-1.x.
Comment #184
greggles@deanflory I mentioned that it applies cleanly to the tip of 7.x-1.x branch. If the version you have is something else it might not apply. For example, I get 2 hunk fails on 7.x-1.0-rc1. Ping me (greggles) on irc if you want to discuss applying patches more (probably other people would be happy to help too, especially if your goal in applying it is to provide a patch review).
Comment #185
deanflory CreditAttribution: deanflory commentedJust reporting what I'm experiencing with the patch in #178 and the latest dev as mentioned in #179:
Last updated: January 5, 2015 - 16:18
Last packaged version: 7.x-1.0-rc1+13-dev
If it's somehow just me then let's not drown this issue with whatever oddity I'm experiencing. "Move along" :)
Comment #186
vadym.kononenko CreditAttribution: vadym.kononenko commentedI can not apply patch #178 too. This part of patch was'n applied.
I see it is applied to module already. So, I've just captured patch after #178 was applied without part above.
Comment #187
Majdi CreditAttribution: Majdi commentedI test the patch in one of the site I develop , it has around 3k visitor/day with 2 languages and we just migrate from the old system, so I redirect many urls , and the module play nice with the patch, thanks
Comment #188
pwiniacki CreditAttribution: pwiniacki commented@Majdi did you use latest #186 patch?
Comment #189
Majdi CreditAttribution: Majdi commented@pwiniacki yes patch #186
Comment #190
jantoine CreditAttribution: jantoine commentedUsing the patch at #186, when locale is enabled using language path prefixes, viewing the home page in any language other than the default language causes a redirect loop. In redirect_url_inbound_alter(), when redirecting the front page to the root level (starting at line 252 of a patched redirect.module file), there is no check that we are at the root level for a language other than the default. I fixed this by adding a comparison between the current language's prefix and the request path.
Updated patch and interdiff attached.
Comment #191
Manuel Garcia CreditAttribution: Manuel Garcia commentedHaven't tested but should this rather be
base_path() . $language->prefix != $request_path
oslt?Comment #192
valentin schmid CreditAttribution: valentin schmid commentedPatch #190 is giving me redirect loops if the option "Redirect from non-canonical URLs to the canonical URLs." is selected. Here's a new patch, which fixes this issue.
It also fixes the comment #191.
Comment #193
valentin schmid CreditAttribution: valentin schmid commentedThe function redirect_load_by_source must return "The first matched URL redirect object", not a list of objects.
Patch #193 fixes this issue. It is now also possible to apply patches from issue #1796596.
Comment #195
valentin schmid CreditAttribution: valentin schmid commentedD'oh! Forget to change a line in patch #193. Hope this one is better!
Comment #196
ramotowski CreditAttribution: ramotowski commentedI can confirm that the code from the last patch #195 works great.
Comment #197
Dave ReidComment #198
kelutrab11 CreditAttribution: kelutrab11 commentedSo this patch makes redirect module (besides some of it's other functions) work as global redirect? I don't need to install global redirect then?
Comment #199
Majdi CreditAttribution: Majdi commentedyes no need for global redirect
Comment #200
pwiniacki CreditAttribution: pwiniacki commented#195 is working very good. Great work!
EDIT: also applied to rc-3 - working good.
Comment #201
dillix CreditAttribution: dillix commented#195 works great! Please commit this.
Comment #202
miro_dietikerDave Reid, you proposed to merge global redirect functionality into redirect module?
We hesitated with going forward with adding this functionality to 8.x branch because this issue was stuck for years.
Should we go ahead and merge our 8.x global redirect functionality into redirect module port and thus deprecate the 8.x port of global redirect? It would be a good moment to do so before Drupal 8 is released.
Comment #203
kelutrab11 CreditAttribution: kelutrab11 commented@miro_dietiker +1 for the idea.
Comment #204
Majdi CreditAttribution: Majdi commentedJust one more point , globalredirect has this option "Case Sensitive URL Checking" I think this is missing in this patch
Comment #205
Dave ReidYes, this is still planned for the 7.x module, so I would say it should go in 8.x. I'm just a bit more focused on trying to get everyone a stable 1.0 release they deserve in Drupal 7 now, before I go back to features again.
Comment #206
dillix CreditAttribution: dillix commentedDave Reid, will you make next RC with this patch?
Comment #207
DamienMcKennaTo anyone who didn't quite understand Dave's comment #205, what he meant was that he's not going to add more features to v7.x-1.0, he's focusing on bug fixes so that the final 1.0 release is stable. However, once 1.0 is out he'd consider adding new features, including this one.
That said, Dave, you added the "D7 stable release blocker" tag to this back in comment #48, if you no longer feel that's appropriate could you please remove the tag to help avoid confusion, because you've basically indicated for four years this would be included? Thanks.
Comment #208
dillix CreditAttribution: dillix commentedDamienMcKenna, Dave added D7 stable release blocker tag, so I confused...
Comment #209
dillix CreditAttribution: dillix commentedAlso as I can see this is last bug with this tag, which not fixed yet:
https://www.drupal.org/project/issues/search?text=&projects=Redirect&ass...
Comment #210
DamienMcKenna@dillix: I know, I pointed out the discrepancy in my comment #207. Dave's at NYC Camp, lets see what he says when he gets to somewhere with wifi and a power source.
Comment #211
dillix CreditAttribution: dillix commentedIf this patch will be committed it would be great, so we can drop Global Redirect!
Comment #212
rikvd CreditAttribution: rikvd at Clockwork commentedthe latest patch does not play nicely with i18n, it checks against the current set language.
node/1 alias: foo language: en
if the user goes to node/1, with default language nl isn't redirected to en/foo
edit: found an article, to get the desired result, maybe it's an good idea to intergrate the snippet in the patch
https://www.drupal.org/node/1280468#comment-6229920
Comment #213
pwiniacki CreditAttribution: pwiniacki commented@rikvd nice catch. Confirmed.
Comment #214
dillix CreditAttribution: dillix commented@rikvd, @pwiniacki may be we should commit this & open new issue for compatibility with i18n?
Comment #215
Sebastien M. CreditAttribution: Sebastien M. as a volunteer commentedHi agree with @dillix.
This fix is quite stable and so useful. It should be interesting to merge it now and go further with a new issue.
Comment #216
pwiniacki CreditAttribution: pwiniacki commented@dillix ok, cause this patch is working fine with basic page functionality. However more i18n and DA test are welcome so 1.0 release can be bug free and used in more complex sites.
Comment #217
DamienMcKennaHas anyone tried the Multilink Redirect submodule from Multilink to resolve the problem with i18n redirects?
Comment #218
Dave ReidMy concern right now is stability of the 7.x-1.x branch and not adding new features before the 7.x-1.0 release. I *do very much* want to get this in so I'm going to open a new 7.x-2.x branch which addresses some major architectural changes (moving the redirect counting to a separate sub-module) as well as this issue as a first priority.
Comment #219
Dave ReidComment #221
DamienMcKennaThanks for the update, Dave.
Comment #222
Dave ReidComment #223
jenlamptonPatch in 195 applies cleanly to the 2.x branch as it is now.
Comment #224
Xrobak CreditAttribution: Xrobak commentedIs it possible to do an ability "Case Sensitive URL Checking" (If enabled, the module will compare the current URL to the alias stored in the system. If there are any differences in case then the user will be redirected to the correct URL.) like in Global Redirect?
Comment #226
NWOM CreditAttribution: NWOM commentedI tried applying #195 to 7.x-2.x-dev, but it seems to not apply cleanly. Anyone else having this issue?
Edit: Nevermind, it appears falling back to the patch tool allows it to apply cleanly.
Comment #227
DamienMcKennaRerolled.
Comment #228
NWOM CreditAttribution: NWOM commented#227 applied cleanly with git. Thank you!
Comment #229
kclarkson CreditAttribution: kclarkson commentedHas anyone updated the maintainers of Global Redirect?
Also is all of this functionality going to be merged for the 8.x version?
Comment #230
delacosta456 CreditAttribution: delacosta456 commentedHi
doest it mean that with this patch we do not need to install any more the Golbal redirect module?
thanks
Comment #231
DamienMcKenna@delacosta456: Yes, that is the plan :)
Comment #232
delacosta456 CreditAttribution: delacosta456 commentedok thanks
Comment #233
naveenvalechaLet;s get this dang in.
Comment #234
glass.dimly CreditAttribution: glass.dimly commentedWould love to see this rolled into the 2x dev version. It's not, right?
Comment #235
DamienMcKennaIt'd also be good to get this functionality into the D8 branch.
Comment #236
DamienMcKennaComment #237
BerdirThis has been part of redirect 8.x-1.x for a long time, see also #2704213: "Redirect from non-canonical URLs to the canonical URLs" not working with language code in url for refactoring that again to get something that is close to what is being worked on for core itself.
Comment #238
DamienMcKenna@Berdir: That's awesome, thanks for the update!
Comment #239
ciss CreditAttribution: ciss at yousign GmbH commentedSomething I just noticed:
$options doesn't seem to be defined anywhere.
We've also noticed that the deslash option is quite aggressive, redirecting POST requests to a custom services endpoint to their deslashed GET version. I'm pretty certain that any request other than GET should be left alone.
Comment #240
kscheirerwhile comment #239 is correct this patch works well for many people (myself included) on production environments. Given this is listed as a blocker for a 1.0 release (in #236) , I think we could handle the $options['language'] in a new issue and commit this.
Alternatively, let's move this back to a 2.0 release blocker and move forward with 1.0. There does not seem to be any difference between the 1.x and 2.x branches at this time.
Comment #241
eelkeblokUnfortunately, we've found a security issue that is introduced by this patch. My colleague will upload an update shortly.
Comment #242
r.van.doorn CreditAttribution: r.van.doorn commentedFor my current project we found a vulnerability in the patch from #239.
When 'Redirect from non-clean URLs to clean URLs.' is enabled you can use the q variable for an open redirect.
I've made a small change to the patch that blocks external urls when redirecting with $_GET.
It's pretty much the same code that was added tot drupal_goto in 2010 (https://www.drupal.org/node/731710)
Comment #243
eelkeblokNitpick: this comment line exceeds 80 characters which is a violation of the coding guidelines.
Otherwise, the resolution of the open redirect issue looks fine.
Comment #244
eelkeblokComment #245
eelkeblokI did a full once-over of the patch. I have the actual code changes ready to go, I just need to turn them into a patch. Most stuff is coding guidelines, although I also addressed the points in #239.
This call to t() does not work, because the string is single quoted, but also contains single quotes. Not sure why it isn't failing harder than it is all I am seeing is that the
optiondescription does not show up (the option itself shows up when the one above it is enabled).Coding standards dictate there needs to be a space between the cast and the variable.
Same thing.
And again. Also, this line gets too long according to phpcs.
Again space after the cast.
Inline comment needs to end in a full stop (or other ending punctuation).
And again the cast thing.
...
Cast. And also this line doesn't pass the length test according to phpcs.
Cast.
And the cast thing one final time.
This seems a small API change that doesn't really belong in this patch, although I expect this will be a slight improvement, since the function would error out anyway when something other than an object was passed.
Line just slightly too long, causing ugly yellow lines in my code editor.
Comment #246
eelkeblokHere's the patch implementing the above and #239.
Comment #247
eelkeblokComment #248
Phil Wolstenholme CreditAttribution: Phil Wolstenholme at CTI Digital commentedAm I imagining things or was this in the 8.x branch and then removed?
Our redirect.settings.yml file contains things like
frontpage_redirect: true
anddeslash: true
but these no longer have an effect in 8.x-1.0-alpha4.Comment #249
eelkeblokI think you're right; when looking in the copy of the code I have at least there is some stuff that seems to implement the frontpage_redirect option. However, since this issue is about getting this *into* the D7-version (and considering it already is an extremely long issue as it is), please create a new issue about this. (Or maybe do a little more thorough search that I did for issues about temporarily disabling this, or something).
Comment #250
kscheirerpatch in #246 is working for me, thanks!
Comment #251
giupenni CreditAttribution: giupenni commented#246 works for me
Comment #252
klonosJust a quick question: after this has been implemented, is there any reason for site that uses both redirect and global_redirect to actually keep both modules enabled? If not, it would be useful to:
a) make sure that all respective settings from globai_redirect are being "migrated" over to redirect
b) there is a warning in the site status stating the fact that global redirect can now be safely disabled and then removed.
Just my 2c
Comment #253
eelkeblokGood point. Should we maybe go as far as turning the module off in an update hook (and still check in the status message whether it was turned on again)?
Comment #254
eelkeblokHere's some preliminary steps (an update hook and an addition to the install hook to migrate the settings). However, when I was creating the mapping for the settings, I found that at this point at least, Global Redirect seems to do a bunch more stuff than this patch is adding to Redirect. These settings from Global Redirect have no equivalent in this patch:
See http://cgit.drupalcode.org/globalredirect/tree/globalredirect.admin.inc?... for a description of what they do (canonical and content_location_header might legitimately be referred to metatag module, I think).
Simply disabling the module and displaying a warning if it is enabled again seems a much less appealing option now. How should this be handled? Should Global Redirect remain a valid addition for some more specialized options..? Should the extra options also be merged into this patch? Maybe later in a follow-up? Not entirely sure what the best path forward is.
Comment #255
eelkeblokComment #256
vinayjain CreditAttribution: vinayjain commentedIt would be great to see the case-sensitive URL option (mentioned in #224), which was part of Global Redirect (as noted in #254), included in this module. The feature allows one to prevent duplicate URLs (case variants), which was among the primary goals of Global Redirect. There seems to be no good solution to achieve that functionality (I'd love to know if there is any).
Comment #257
kclarkson CreditAttribution: kclarkson commented@eelkeblok,
My vote would be to add the case-sensitive URL option in there. Apply the patch and then create tickets of all the other features. It will be much easier to maintain and check the progress with different tickets.
Comment #258
tomsegarra CreditAttribution: tomsegarra as a volunteer commentedAs recommended in the previous two comments, I've implemented the case-sensitive URL option, along with a test for that option.
This seems to be in good shape. I agree with #257: it'd make sense to defer the rest of the Global Redirect features for now, so we can get a stable release and prevent this convoluted issue thread from getting longer.
Comment #259
das-peter CreditAttribution: das-peter at Cando commentedJust ran into trouble with this.
$request_uri
easily can be the processed value from$_GET['q']
which means it never has a language prefix.I suppose we always should use the raw version returned by
request_path()
to see if the language prefix was / is set.Comment #260
rajiv.singh CreditAttribution: rajiv.singh at Axelerant commentedRe rolled patch #166
Comment #261
DamienMcKennaComment #263
ciss CreditAttribution: ciss at yousign GmbH commented@rajiv.singh Please don't reroll ancient patches.
Comment #264
c7bamford CreditAttribution: c7bamford commentedChanged the update number from 7103 to 7104 to work with the newest dev version of this module.
Comment #265
c7bamford CreditAttribution: c7bamford commentedThe previous patch is an update of patch 258.
Comment #266
Chris Matthews CreditAttribution: Chris Matthews commentedAfter trying to apply the patch in #264
redirect.install
error: patch failed: redirect.install:432
error: redirect.install: patch does not apply
redirect.module
error: patch failed: redirect.module:1122
error: redirect.module: patch does not apply
redirect.test
Hunk #1 succeeded at 311 (offset 27 lines)
Comment #267
eelkeblokComment #268
eelkeblokActually, I may have been a bit quick. To what version did you apply the patch? #264 says it is meant for the latest dev version.
Comment #269
Alan D. CreditAttribution: Alan D. commentedChanging status back . The invalid patch in #260 changed this to Needs work, I personally haven't reviewed this at all.
This should also check if the latest patch (#264) applies to dev ;)
Comment #271
Chris Matthews CreditAttribution: Chris Matthews commented>> 7.x-1.x-dev
Comment #272
Alan D. CreditAttribution: Alan D. commentedComment #273
c7bamford CreditAttribution: c7bamford commentedRerolled again. If you've used previous versions of this patch, you're going to have to change update numbers to get all the updates to work. This is for the d7 1.x branch on commit e61ef3d.
Comment #274
c7bamford CreditAttribution: c7bamford commentedRemoved needs reroll tag
Comment #275
c7bamford CreditAttribution: c7bamford commentedSame patch, but with fewer errors.
Comment #276
kscheirerComment #277
Chris Matthews CreditAttribution: Chris Matthews commentedThe patch in #275 does not apply to the latest 7.x-1.x-dev and needs another reroll.
Comment #278
c7bamford CreditAttribution: c7bamford commentedThis patch applies to 7.x-1.x at commit 523778d3.
Comment #279
Chris Matthews CreditAttribution: Chris Matthews commentedThis issue is a child of #2514248: Plan for Redirect v7.x-1.0 release. Should it continue to be blocker for a full 7.x-1.0 release of redirect?
Comment #280
jedsaet CreditAttribution: jedsaet as a volunteer commentedRe-roll of the patch in 278 against commit 7f9531d0 for 7.x-1.x
Comment #281
andralex CreditAttribution: andralex at EPAM Systems commentedThe patch from #280 successfully applied locally.
I've found a few coding standard issues:
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Line indented incorrectly; expected 4 spaces, found 6
Line indented incorrectly; expected 8 spaces, found 10
Line indented incorrectly; expected 8 spaces, found 10
Missing function doc comment.
Visibility must be declared on method "testCaseSensitiveUrls"
Expected 1 blank line after function; 0 found
Comment #282
andralex CreditAttribution: andralex at EPAM Systems commentedThis also needs to be added into
redirect_variables()
so variables will be removed inhook_uninstall()
Comment #283
NWOM CreditAttribution: NWOM commentedNeeds work including the changes from #281 and #282.
Comment #284
andralex CreditAttribution: andralex at EPAM Systems commentedHere is reroll of patch #280 with changes from #281 and #282.
Comment #285
jenlamptonPatch in #284 is working for me. Marking as RTBC.
Comment #286
Kristen PolAssigning to myself as I'm triaging all RTBC issues.
Comment #287
BerdirNote that this is a D7 issue, I'm not maintaining that, only 8.x-1.x, that was the original agreement with Dave and i think we shouldn'r be making non-trivial changes to 7.x-1.x at this point.
Comment #288
Kristen PolThanks @Berdir. Yeah, I'm assigning everything that's RTBC to me in order to triage and see what is still valid and what's not and hopefully move issues forward or close them out.
I agree that this is a major issue and might be dicey to merge at this point. It's a shame though given everyone's hard work. Though, there is a patch people can use that was RTBC'ed so they can always use that.
I'd love to give issue credit for everyone's hard work on this but let me think how to best do that while marking this one as "won't fix". Postponing for the moment.
Comment #289
steinmb CreditAttribution: steinmb at University Of Bergen commentedGiven the current activity on D7 modules it might be difficult to legitimise the use of developer/maintenance time doing so. The issue is marked with "needs tests" though the patch introduce a single test with two assertions. Not sure if the tag was not removed or that this is too little tests. That might tip the scale. We could create a new branch and move this to, 7.x-2.x as an experimental feature. Not sure we win anything by doing so?