Integrate with url_alter.module
Dave Reid - July 24, 2009 - 21:34
| Project: | Persistent URL |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Because your module wants to implement custom_url_rewrite_outbound, if other modules want to define it or implemented they are not able to since it can only be defined once and could possibly cause PHP fatal errors in other modules if they do not check if the function is not already defined.
I've created the url_alter module to help convert this into a hook that modules can use, and I want to provide patches to all the modules that want to implement custom_url_rewrite functions to be able to take advantage of it.

#1
Patch attached for review.
#2
Hello? Any interest in helping make things more compatible?
#3
This is a 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 purl_url_alter_outbound() to purl_url_outbound_alter() in the patch. 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)!
#4
Dave, thanks for the patch and updates. I need to look more closely at this issue, which I simply haven't had time for. My concern here is that purl isn't designed with the idea that there could be other players in the url rewriting battle. As such I'm not eager to open the door on a lot of incompatibility that stems from design decisions in purl that wouldn't be easy to fix.
Hearing more about how people would use purl with other implementors of custom_url_rewrite_inbound() and custom_url_rewrite_outbound() would help.
#5
For instance, the FeedBurner module wants to rewrite paths for 'rss.xml' to 'http://feeds.feedburner.com/my-drupal-feed'. It does this by using hook_url_outbound_alter() via url_alter.module or custom_url_rewrite_outbound if the function hasn't been defined yet. Now if the same person wants PURL functionality, only one of the modules can implement the custom_url_rewrite_outbound function, and the other is screwed. If both modules implement hook_url_outbound_alter() and the user has the url_alter.module installed, both get executed.
#6
+1
#7
Thanks. Committed http://drupal.org/cvs?commit=303678
#8
Automatically closed -- issue fixed for 2 weeks with no activity.