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.

CommentFileSizeAuthor
#1 530326-url-alter.patch4.52 KBdave reid

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new4.52 KB

Patch attached for review.

dave reid’s picture

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)!

Flying Drupalist’s picture

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

savioret’s picture

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 !

dave reid’s picture

@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.

savioret’s picture

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

dave reid’s picture

@birwel: Yes, please open a separate issue.

setvik’s picture

Committed. Thanks for the patch!

setvik’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Th30philus’s picture

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?

jim kirkpatrick’s picture

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.

Status: Fixed » Closed (fixed)

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