With the Persistent URL module enabled (http://drupal.org/project/purl), this module does not work at all. All the URLs it changes are 404's.
PURL is needed for modules such as http://drupal.org/project/mobile_tools.
I tracked it down to the fact that hook_url_inbound_alter() is getting called multiple times. After the first time $original_path
is set to "user"
so that makes if (preg_match('|^user(?![^/])|', $original_path))
evaluate to true
.
I'm not sure which module would need changed to make them compatible. I don't really use the PURL module. I was just testing out Mobile Tools and had it enabled. So, I can't help you much in the way of info on what it's supposed to do. But it may have to do with the module's custom_url_rewrite_outbound().
Comment | File | Size | Author |
---|---|---|---|
#13 | rename_admin_paths-work_with_purl-1703242-13.patch | 788 bytes | Raphael Apard |
#5 | work_with_purl-1703242-5.patch | 1.58 KB | SolomonGifford |
Comments
Comment #1
Raphael Apard CreditAttribution: Raphael Apard commentedFixed by #1703214: User subpaths don't work (create, password)
Comment #2
cwithout CreditAttribution: cwithout commentedThanks for committing the fix to the other issue.
I'm not sure why you marked this fixed though. That issue isn't related. I'm sure there are ways both could be fixed at the same time, but it would need a bigger rewrite than the patch in that issue.
I tried out the current dev to be sure, and enabling purl still causes all the renamed admin paths to result in 404's.
Comment #3
Raphael Apard CreditAttribution: Raphael Apard commentedThx for reporting.
Comment #4
SolomonGifford CreditAttribution: SolomonGifford commentedThe following needs to be added to the beginning of rename_admin_paths_url_inbound_alter. The root problem may be with purl, however. Ultimately, the problem is the purl module causes url_inbound_alter to be invoked twice. I think the second time through, original_path is set to the modified path of the first time through.
Comment #5
SolomonGifford CreditAttribution: SolomonGifford commentedActually, I found a better solution that doesn't depend on purl. See attached patch. I've borrowed ideas used in the purl module to make sure this happens only once but early in the process.
Comment #6
Raphael Apard CreditAttribution: Raphael Apard commentedThx,
#4 and #5 are both working ?
Just looking on code, #4 looks simpliest and not imlements hook_init().
I don't now how much module can causes url_inbound_alter to be invoked twice.
I prefer take the solution #4 for now and we'll see.
Thank again for you help on it.
Comment #7
Raphael Apard CreditAttribution: Raphael Apard commentedCommited.
Comment #8
cwithout CreditAttribution: cwithout commentedTested and working.
Thanks, solomongifford. I'm currently using the Context Mobile Detect mobile for mobile needs, but if I ever need Mobile Tools or another module that requires PURL, it's nice to know this Rename Admin Paths will be compatible.
Comment #9
SolomonGifford CreditAttribution: SolomonGifford commentedRaphael,
#4 only fixes the problem for people with PURL enabled. The reason PURL invokes url_inbound_alter twice is because it calls drupal_path_initialize() from its init function.
The reason I think #5 is the better solution is because this module will have the same incompatibility with any other module that invokes drupal_path_initialize(). #5 solves this problem generically in the same way the PURL module solves the problem.
If your primary aversion is the implementation of hook_init, simply remove it from the patch in #5 - the reason I added it was to model PURL's solution and invoke much earlier in the process.
Either way, thanks for committing.
Solomon
Comment #10
cwithout CreditAttribution: cwithout commentedOh. I didn't look at the code. I assumed the patch in #5 was what got committed. I agree with solomongifford. That's a better solution.
Comment #12
Raphael Apard CreditAttribution: Raphael Apard commentedre-open for a better solution.
Comment #13
Raphael Apard CreditAttribution: Raphael Apard commentedHere the #5 solution (light). If somenone can test it with purl ;).
Comment #14
cwithout CreditAttribution: cwithout commented#13 tested and works with the current 7.x-1.0-beta1 of PURL.
Comment #15
Raphael Apard CreditAttribution: Raphael Apard commentedthx. commited to dev.
Comment #16
Raphael Apard CreditAttribution: Raphael Apard commented