I use Drupal here, and also for the LinkSphere project. The LinkSphere URL is in my institution's domain, and redirects to the site itself. Most things work fine - but forms do not get the right base URL. And so far, I haven't been able to figure out why.
At the moment, I get round it using a really dirty hack (complete with hardcoded element of the path - *shudder*)
function theme_form($element) {
// Anonymous div to satisfy XHTML compliance.
//For some reason, the base_path is not being used on form generation. I have hard coded it in here
//but there were two cases where it *was* being included... so I have checked it isn't already there
//this should, of course, use the variable, not a hard coded string. (need to figure out how to access it...)
if (substr($element['#action'],0,11)!='/linksphere')
$element['#action'] = '/linksphere' .$element['#action'];
$action = $element['#action'] ? 'action="'. check_url($element['#action']) .'" ' : '';
return '<form '. $action .' accept-charset="UTF-8" method="'. $element['#method'] .'" id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
}Which, obviously, is something I really, really shouldn't be doing. The base_path is configured to include the /linksphere bit, but using the base_path would be excessive (absolute URL) and, what's worse, didn't work.
Even stranger, a couple of the forms *did* pick up the /linksphere part of the URL, which is why I check to see whether it already exists in the action element. Some more rummaging to be done, methinks.
This work is licensed under a Attribution Non-commercial Creative Commons license
Comments
Hi, I want to talk to you
Hi, I want to talk to you about sponsorship on your website, how can I get in touch with you? - simple ways to lose weight
Contacting me...
I'm not quite sure what you mean by sponsorship on my site... but you can find my email address online on various pages, for instance ones related to JISC projects I have been involved in. I try not to publicise it too obviously in order to cut down the amount of spam...