[development] a couple things to discuss about base_path()

Matt Westgate matt at lullabot.com
Tue Mar 7 05:09:04 UTC 2006

While base_path() does many a good thing, it also presents a couple  
of obstacles that could use further discussion.

- Enabling or disabling clean_urls on a site with content will break  
hand-rolled links. For example on my staging server clean_urls are  
disabled but they're enabled in production. If I continue to do that,  
my links will break.

- Moving a Drupal site from one subdirectory to another or from a  
subdirectory up to a root folder will break links if the site is  
using clean_urls.

How should we solve these problems? A couple of ideas. Let's pick one.

1) Provide a link updater script in the scripts/ folder

2) Add some sort of 'fix my links' button via the admin interface

3) Hook a URL fixing script into the clean_url form toggle so it runs  
after the setting has changed.

4) Make a link-updater contrib module to point users to.

I'm in the camp of #4 since I see this as a rarely used interface  
option. Oh, and I'm also volunteering my time to write the mod.

Matt Westgate | www.lullabot.com

More information about the development mailing list