Prevent custom_url_rewrite_outbound collision and integrate with url_alter.module

Dave Reid - July 24, 2009 - 21:23
Project:Subdomain
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Because your module implements custom_url_rewrite_outbound and it is not a hook, if another module defines the function or someone has it in their settings.php, it can conflict and cause fatal PHP errors. I've created the url_alter module to help convert this into a hook that modules can use, but I also want to help provide a fix that will prevent the PHP fatal errors if the function is already defined.

#1

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

Patch attached for review.

AttachmentSize
530326-url-alter.patch 4.52 KB

#2

Dave Reid - October 24, 2009 - 06:11

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 subdomain_url_alter_inbound() to subdomain_url_inbound_alter() and subdomain_url_alter_outbound() to subdomain_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)!

#3

Flying Drupalist - November 2, 2009 - 20:33

If I apply this patch does this mean I won't have to alter settings.php any more.

#4

birwel - November 3, 2009 - 19:14

I have applied the patch and subdomain module works.
The problem now is that enabling Sub-path URL Aliasing (for exxample editing a node using author mode in subdomain module) the path appears as:

http://mydomain.com/~username/content/content-title/edit

Am I doing anything wrong?
thanks !

#5

Dave Reid - November 3, 2009 - 20:38

@Flying Drupalist If you had the URL alter module installed, yes it would run it for you and you wouldn't need to make any additions to settings.php.

#6

birwel - November 4, 2009 - 22:23

Any advice for the problem of #4 ?
Should I open it in a separate issue ?

#7

Dave Reid - November 4, 2009 - 22:38

@birwel: Yes, please open a separate issue.

 
 

Drupal is a registered trademark of Dries Buytaert.