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'));
CommentFileSizeAuthor
#1 is_front.patch697 bytesRayZ
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RayZ’s picture

Status: Active » Needs review
FileSize
697 bytes

I confirm the bug and the fix. Patch attached.

beginner’s picture

Check those issues and close the duplicates:
http://drupal.org/node/78398
http://drupal.org/node/70177

RayZ’s picture

http://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.

RobRoy’s picture

The approach here looks good. +1

RTBC?

beginner’s picture

is this a new incarnation of the same?
http://drupal.org/node/78129

RobRoy’s picture

I 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

RayZ’s picture

Status: Needs review » Reviewed & tested by the community

Boldly setting as RTBC.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

killes@www.drop.org’s picture

also to 4.7

Anonymous’s picture

Status: Fixed » Closed (fixed)