Posted by Dave Reid on July 24, 2009 at 9:23pm
| 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
Patch attached for review.
#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
#10
Automatically closed -- issue fixed for 2 weeks with no activity.
#11
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
@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:
#13
Automatically closed -- issue fixed for 2 weeks with no activity.