Download & Extend

Prevent custom_url_rewrite_outbound collision and integrate with url_alter.module

Project:Subdomain
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

Status:active» needs review

Patch attached for review.

AttachmentSize
530326-url-alter.patch 4.52 KB

#2

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

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

#4

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

@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

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

#7

@birwel: Yes, please open a separate issue.

#8

Committed. Thanks for the patch!

#9

Status:needs review» fixed

#10

Status:fixed» closed (fixed)

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

#11

Status:closed (fixed)» needs review

I noticed the 6.x-1.7 release is dated after the date of the commit of this patch.

Is this patch in the 6.x-1.7 release? or is it only in 6.x-1.x-dev?

#12

Status:needs review» fixed

@LegacyAtty - I confirm these settings.php methods are not required in 6.x.1.7... FYI this module's readme.txt file in the module says:

Upgrading from any of the previous 6.x versions (i.e 6.x-1.5 or below):

Subdomain no longer needs the custom functions in settings.php
Please review your settings.php and remove the following two
functions if present (NOTE: If you've made customizations to
these functions that you still need, install the url_alter
module and migrate your customizations to a custom module
using the hooks provided by url_alter.

#13

Status:fixed» closed (fixed)

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

nobody click here