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

Dave Reid - July 24, 2009 - 21:35
Status:active» needs review

Patch attached for review.

AttachmentSize
530338-url-alter.patch 1.59 KB

#2

Dave Reid - September 29, 2009 - 03:45

Hello? Any interest in helping make things more compatible?

#3

Dave Reid - October 24, 2009 - 06:12

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

jmiccolis - October 31, 2009 - 15:03

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

Dave Reid - November 22, 2009 - 18:51

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

leovarg - December 5, 2009 - 02:43

+1

#7

yhahn - December 17, 2009 - 20:55
Status:needs review» fixed

Thanks. Committed http://drupal.org/cvs?commit=303678

#8

System Message - December 31, 2009 - 21:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.