Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedTake it away and find out... it 7.x-3.x I included a better explanation:
Comment #2
unleet CreditAttribution: unleet commentedWow... 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.
Comment #3
unleet CreditAttribution: unleet commentedI'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.
Comment #4
Jeff Burnz CreditAttribution: Jeff Burnz commentedPretty 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()
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.
Comment #6
Danny EnglanderI 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