This code is in template_process.inc:

  // Work-around a stupid bug in Drupal 7
  if (arg(0) == 'user' && arg(1) == 'login') {
    drupal_set_title(t('User login'));
  }
  if (arg(0) == 'user' && arg(1) == 'password') {
    drupal_set_title(t('Request new password'));
  }
  if (arg(0) == 'user' && arg(1) == 'register') {
    drupal_set_title(t('Create new account'));
  }

What bug in Drupal 7 is this working around?

Comments

Jeff Burnz’s picture

Take it away and find out... it 7.x-3.x I included a better explanation:

  // Work around a perculier bug/feature(?) in Drupal 7 which incorrectly sets
  // the page title to "User account" for all three of these pages.
unleet’s picture

Status: Active » Fixed

Wow... that would have taken a lot longer to figure out than it took to find out this code was there.

Thanks for the quick answer.

unleet’s picture

I'm going to throw a little more info in here for anyone who stumbles on to this ticket looking for the same information I did.

This bug/feature in Drupal 7 core also affects the breadcrumb text for the pages in question. If you want to override these page titles, you will need to take this into account.

No need to take this as a feature request for AdaptiveTheme. It's just a thing I discovered related to this issue, so I want to make sure anyone coming after me knows about it.

Jeff Burnz’s picture

Pretty sure in 7.x-3.x I accounted for that also, by blowing the breadcrumbs away entirely on the register new password pages (except for the home link, if you have that set):

In theme_breadcrumb()

    // Remove the rather pointless breadcrumbs for reset password and user
    // register pages, they link to the page you are on.
    if (arg(0) === 'user' && (arg(1) === 'password' || arg(1) === 'register')) {
      array_pop($breadcrumb);
    }

What happens is there is no breadcrumb trail (other than home) for the login page, but IS for these two pages, and they both link to the page you are already on.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Danny Englander’s picture

I just ran up against this issue myself and this fix worked perfectly in another theme I am working on, thanks! It looks like there is a long standing issue in core for this being addressed for Drupal 8: http://drupal.org/node/1251188