When path aliases are used for nodes, and the theme is told to display the mission statement, the mission will not display if the home page in /admin/settings is set to an alias.

To reproduce this do the following:

1. Go to /admin/modules and enable the path module, if not already enabled
2. Create a node of type page, and enter an alias for it (e.g. home.html)
3. Go to /admin/settings and set the Drupal default front page to be home.html
4. Go to admin/themes and select Pushbutton (or any theme using xtemplate engine), make it the default
5 Go to /admin/themes/settings and enable Mission statement

Now go to the home page of your site, and you will NOT see the mission displayed.

Some debugging shows that the culprit is this section of code in /themes/engines/xtemplate/xtemplate.engine:

  if ($_GET["q"] == variable_get("site_frontpage", "node") && theme_get_setting('toggle_mission') && ($mission = theme_get_setting('mission'))) {
    $xtemplate->template->assign("mission", $mission);
    $xtemplate->template->parse("header.mission");
  }

The problem is $_GET["q"] stores "node/1" and not "home.html", so the above condition is never met, and the mission does not get displayed.

The workaround is to put in /admin/settings the drupal node path (e.g. node/1) instead of home.html, the mission will be displayed then.

CommentFileSizeAuthor
#8 mission.patch460 bytesbudda
#4 phptemplate.diff685 byteskuba.zygmunt

Comments

killes@www.drop.org’s picture

xtemplate is no longer part of core.

kbahey’s picture

The problem still occurs on phptemplate themes (e.g. Pushbutton) under 4.6.

eferraiuolo’s picture

I also have run into this problem but from a different angle. I tried using taxonomy terms to be displayed on the front page along with the mission statement; I can get this to work, but not without getting an error/warning. So I tried creating an URL alias for my taxonomy terms url, but then the mission statment wasn't being displayed as you pointed out!

Example:
I set Administer >> Settings >> Default front page to:
taxonomy/term/15,7

Also Mission Statement is toggled on under Administer >> Themes and the result was what I was after; the front page displaying the mission statement along with all content tagged with Term 15 & Term 7. But I also got something I didn't want, a Warning/Error:
warning: preg_match() [function.preg-match]: Unknown modifier 't' in /home/ewebportals/web/public/schoolcraft/modules/block.module on line 474.

To Fix the Error I did:
I created an URL Alias in Administer >> URL Aliases
System Path: taxonomy/term/15,7
Alias Path: everyone/common

I then replaced taxonomy/term/15,7 (my default front page URL) to everyone/common; but the error was still present, and I lost my mission statement.

Finally I edited my URL Alias from everyone/common to everyone_common; this got rid of the error, but still my mission statement wasn't being displayed.

My Debug Trace:
I tried to track down my error and ended up the same place you did, but my theme is using PHPTemplate Engine; so I tracked the bug to file:

themes/engines/phptemplate.engine:

if ($_GET['q'] == variable_get('site_frontpage', 'node')) {
    $mission = theme_get_setting('mission');
    $frontpage = true;
  }
kuba.zygmunt’s picture

StatusFileSize
new685 bytes

To solve this in phptemplate I check if in database exists alias for main page(table {url_alias} ) and then check if ( ($_GET['q'] == variable_get('site_frontpage', 'node')) || ($_GET['q'] == $alias->src ) )

kuba.zygmunt’s picture

for me this diffs works so I change the status to patch

aaron’s picture

+1 for 4.6.3. I haven't tested it in 4.7. Fixes the problem without a hitch, from what I can tell.

moshe weitzman’s picture

Status: Needs review » Needs work

I think the right thing to do is to use drupal_get_normal_path() and then compare to $site_frontpage

budda’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new460 bytes

Can't believe this still hasn't been fixed since 4.6 days.

Attached is a patch against the phptemplate.engine from Drupal HEAD

markus_petrux’s picture

Status: Reviewed & tested by the community » Needs work

You may want to remove $frontpage or set it in the variables array. It is not used, actually.

budda’s picture

Status: Needs work » Reviewed & tested by the community

The $frontpage variable is there all along in phptemplate.engine, I don't know what it's intended for so have not touched it.

This patch is to fix the broken mission statement bug, and fixes this. Cleaning up other phptemplate code can be done seperately.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)