[drupal-devel] [bug] Mission does not get displayed if it is a path alias

kubaZygmunt drupal-devel at drupal.org
Thu Jun 23 12:44:22 UTC 2005


Issue status update for http://drupal.org/node/17291

 Project:      Drupal
 Version:      cvs
 Component:    theme system
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  kbahey
 Updated by:   kubaZygmunt
-Status:       active
+Status:       patch

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




kubaZygmunt



Previous comments:
------------------------------------------------------------------------

February 14, 2005 - 01:22 : kbahey

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:



<?php
  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.




------------------------------------------------------------------------

June 11, 2005 - 23:53 : killes at www.drop.org

xtemplate is no longer part of core.




------------------------------------------------------------------------

June 12, 2005 - 04:01 : kbahey

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




------------------------------------------------------------------------

June 22, 2005 - 20:09 : eferraiuolo

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;
  }




------------------------------------------------------------------------

June 23, 2005 - 14:33 : kubaZygmunt

Attachment: http://drupal.org/files/issues/phptemplate.diff (685 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 )
)  







More information about the drupal-devel mailing list