I'm using the Modal Forms module to provide Modal Login and Register Forms across my site. Unfortunately it only seems to work if I access the link from a page which is one deep from the host folder. i.e.

  • Localhost/drupal/myform - Works
  • Localhost/drupal/node/31 - Doesn't Work

The error that throws says that

/drupal/node/modal_forms/ajax/login can't be found. Which is correct because the login form is kept at:


It's adding the relative path on the end of the current page path.

A. Has anyone come across or solved this before?


B. I think the code path is being pulled from hook_menu:

function modal_forms_menu() {
    $items['modal_forms/%ctools_js/login'] = array(
      'title' => 'Log in',
      'page callback' => 'modal_forms_login',
      'page arguments' => array(1),

I tried changing the link to a direct path (not relative), but this doesn't do anything. What should I be trying to change to get the path to either load from /drupal/ each time or become direct?

1 Answer 1


This was due to how I implemented the modal forms. I'd put the following path: "modal_forms/%ctools_js/login" in my menu links.

Changing this to an absolute rather than relative path solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.