I have been working on a multisite drupal powered website for about 6 months now and everything seems working well.
Just of recent I found out that my site does not optimize urls. I mean it resolves it only to the base path and not sub-paths.
So I tried to make use of url alter module to help with sub-paths. But since domain moodule makes use of custom_url_rewrite_outbound and url alter module makes use of hook_alter, I then could not go ahead with the removal of domain module's settings_custom_url.inc file.
I have checked series of community posts and all I could find is that I have to look for a way to make custom_url_rewrite_outbound function work without conflict.
But I don't know how. Can anyone help please.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#13 | 529026-url-alter-update.patch | 1.51 KB | agentrickard |
#9 | 529026-outbound-doc.patch | 8.21 KB | agentrickard |
#8 | 529026-outbound-doc.patch | 7.4 KB | agentrickard |
#3 | 529026.patch | 7.13 KB | Dave Reid |
Comments
Comment #1
agentrickardCross-posts are generally frowned on.
It looks to me like it should just work with Domain Acccess rc8. Though you may have to remove lines 16-20 of DA's settings_custom_url.inc.
Comment #2
agentrickard@Dave Reid
We addressed this issue in DA rc8, so I am unsure how this module now plays in. In fact, it looks like the two modules will no longer work together, since DA know checks for the precense of custom_url_rewrite_outbound() in a manner similar to url_alter.
See #450344: domain module steals custom_url_rewrite
I suppose I can change that behavior and require this module instead, but would hate to introducce the dependency at this date.
Comment #3
Dave ReidI've been looking into this. Here's my possible solution:
1. Set the url_alter to have a ridiculously low weight so it is the first module that is loaded in a full bootstrap. Therefore it gets to be the only module that implements the custom_url_rewrite functions.
2. Move the custom_url_rewrite_outbound stuff into domain.module so that it can be loaded after url_alter and since it is only needed on a full bootstrap (for use with url() and l()). Also remove the settings_custom_url.inc file.
Ignore the changes to settings_custom_url.inc in the patch. That file would be removed in this method.
Comment #4
agentrickardWe can also try this. Add these to url_alter() module. Doing so will force the module to load early enough in the bootstrap to run correctly with DA.
But even then, I would need to change the name of my function.
Comment #5
agentrickardMoving back to my queue
Comment #6
Dave ReidProbably need to change the install instructions also.
Comment #7
agentrickardYes.
Comment #8
agentrickardBecause of how Domain Access loads, we cannot insert the !exists logic directly into the module. We have to run that check inside hook_init(), which keeps our version from loading before url_alter module's.
The attached patch tests clean, and includes new documentation. Note that I kept domain_url_rewrite_outbound() as a legacy wrapper function.
I should also note that this line of url_alter.module consistently failed for me:
I had to remove the !isset part of the IF in order to implement stored rules for path rewrites, even when the code was valid (such as $path = 'a';).
Comment #9
agentrickardUpdated patch, committed to HEAD.
Comment #10
Dave Reid@agentrickard: Woot! I'll look into #8. Looking forward to figure out the next Domain Access integration problem: XML sitemap.
Comment #12
Dave ReidFollow-up notice that I'm going to be committing a new version of the URL alter module that changes the hooks to hook_url_inbound_alter() and hook_url_outbound_alter(). This is for consistency with the hooks that were accepted into Drupal 7 (#320331: Turn custom_url_rewrite_inbound and custom_url_rewrite_outbound into hooks)!
Please update domain_url_alter_outbound() to domain_url_outbound_alter() as soon as you can since I'm creating the new URL alter release tomorrow. Plus this will make your module one-step closer to being Drupal 7 compatible (then you can even drop all the custom_url_rewrite juggling)!
Comment #13
agentrickardHere's a new patch against HEAD/rc9
Comment #14
agentrickardCommitted to HEAD.