Drupal form not submitting

When I update some content in drupal I get an error:

"The URL is not valid and cannot be loaded"

Bugga!!




I had that hassle. It's a quirk that I don't know the cause of. I had a fix somewhere here that involved replacing double foward slashes in the action attribute of the form.

I'll search for it soon but you could to a grep search for <form and probably find where to fix it pretty easy.

In includes/form.inc you'll see:

`return '<form '. $action . ' method="'. $element['#method'] .'" '. 'id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";

Change it to:
return '<form '. str_replace(\"//\", \"/\", $action) . ' method=\"'. $element['#method'] .'\" '. 'id=\"'. $element['#id'] .'\"'. drupal_attributes($element['#attributes']) .\">\n<div>\". $element['#children'] .\"\n</div></form>\n\";

This is not the best way to fix it I am sure. But I got too much to do!

oh crap. all those escape thingys!

basically you change $action to : str_replace('\\', '\', $action);

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options