I have a site that uses Drupal, but not in the webroot, it is at /CMS/ (http://caprockpress.com/CMS/).

Its not everywhere, but sometimes the link that is generated to the toboggan/login gets CMS/ appended to the front of it.

If from the front page (http://caprockpress.com/CMS/) You go to register a new account (registration requires admin approval BTW). From the Register page, if you go to the "Login" tab, the link is to http://caprockpress.com/CMS/CMS/toboggan/login. I can work around it by either turning off Clean URLS or by creating a URL Alias to pick it up.

Logging in from the Login Block works fine.

I tried to see if I could come up with an easy patch, but I'm not familiar enough with some of the Drupal functions that are being used.

Comments

pulsifer’s picture

This is probably caused by a URL being generated that looks like this:

href="CMS/toboggan/login"

What the URL should be is this:

href="/CMS/toboggan/login"

I believe the bug is somewhere in user.module in the block of code that reads:


//registration and login pages.
$items[] = array('path' => 'user/login', 'title' => t('log in'),
'callback' => 'user_login', 'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array('path' => 'user/register', 'title' => t('register'),
'callback' => 'user_register', 'access' => $user->uid == 0 && variable_get('user_register', 1), 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'user/password', 'title' => t('request new password'),
'callback' => 'user_pass', 'access' => $user->uid == 0, 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'user/reset', 'title' => t('reset password'),
'callback' => 'user_pass_reset', 'access' => TRUE, 'type' => MENU_CALLBACK);
$items[] = array('path' => 'user/help', 'title' => t('help'),
'callback' => 'user_help_page', 'type' => MENU_CALLBACK);

pulsifer’s picture

I think the bug is in menu.inc and has something to do with menu items marked MENU_DEFAULT_LOCAL_TASK,. Note that MENU_DEFAULT_LOCAL_TASK = MENU_IS_LOCAL_TASK | MENU_LINKS_TO_PARENT.

This has probably been fixed in the cvs version. You could try looking through the commit messages for menu.inc in cvs, or look at a diff between the latest version and version tagged 4.6.0 to see if anything pops out.

http://cvs.drupal.org/viewcvs/drupal/drupal/includes/menu.inc

BTW, menus are cached in the table "cache". This could simply be a problem with the value stored in the cache. I would also try emptying that table and see if that makes a difference.

hunmonk’s picture

Status: Active » Fixed

fixed in latest 4.6 version of the module

Anonymous’s picture

Status: Fixed » Closed (fixed)