With Drupal 4.7.3 drupal_is_front() will always return false if the desired frontpage has an aliased path. If a user creates a page to be used as the front page and give is the path alias of "frontpage" and then on admin/settings enters "frontpage" as the Default front page, the page will become the front page, but the theme variable $is_front will always return false.
This is because drupal compares "site_frontpage" variable directly to the non-drupal aliased $get['q]' path in drupal_is_front_page(). In this case, it checks to see if "frontpage" is the same as "node/x" and returns false.
This could be fixed changing drupal_is_front_page() to run the site_frontpage variable through drupal_get_normal_path(), on line 200 of path.inc like:
return $_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node'));
Comment | File | Size | Author |
---|---|---|---|
#1 | is_front.patch | 697 bytes | RayZ |
Comments
Comment #1
RayZ CreditAttribution: RayZ commentedI confirm the bug and the fix. Patch attached.
Comment #2
beginner CreditAttribution: beginner commentedCheck those issues and close the duplicates:
http://drupal.org/node/78398
http://drupal.org/node/70177
Comment #3
RayZ CreditAttribution: RayZ commentedhttp://drupal.org/node/70177 was a different issue, and is now closed.
Marked http://drupal.org/node/78398 as a duplicate, though reviewers should have a look at the approach taken by that patch.
Comment #4
RobRoy CreditAttribution: RobRoy commentedThe approach here looks good. +1
RTBC?
Comment #5
beginner CreditAttribution: beginner commentedis this a new incarnation of the same?
http://drupal.org/node/78129
Comment #6
RobRoy CreditAttribution: RobRoy commentedI believe this is a different issue as http://drupal.org/node/78129 deals with the breadcrumb link going to the alias name /alias instead of just /.
Our issue here deals with whether we recognize /alias and/or / as the front page. Since they both should be recognized as the front page, we want to normalize the path to figure that out in case a user types in /alias. But, WRT the other issue, we want all Home links to go to whatever is set to.
I think... :P
Comment #7
RayZ CreditAttribution: RayZ commentedBoldly setting as RTBC.
Comment #8
drummCommitted to HEAD.
Comment #9
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedalso to 4.7
Comment #10
(not verified) CreditAttribution: commented