Fullscreen
Loading...
 
Skip to main content

real page name displayed as pagetitle instead of alias

Status
Closed
Subject
real page name displayed as pagetitle instead of alias
Version
11.x Regression
Category
  • Regression
Feature
Wiki (page view, edit, history, rename, etc)
Resolution status
Fixed or Solved
Submitted by
jcarter
Volunteered to solve
Nelson Ko
Lastmod by
Nelson Ko
Rating
(0)
Description

In previous versions of tiki wiki, the alias of a page would show as the pagetitle for that page (assuming pref enabled to do so), but now the pagetitle is the pagename and not the page alias.

workaround below.

Solution
Fixed in r48083. Basically cleaned up jcarter's patch. Thanks jcarter.
Workaround

Modified block at line 360 in lib/breadcrumblib.php changing the code from

Copy to clipboard
} else { $ret .= htmlentities(tra($crumbs[$len-1]->title), ENT_QUOTES, 'UTF-8').'</a>'; }

to

Copy to clipboard
} else { //see if page has alias and if so, set it as title //structure path contains pages and their aliases global $structure_path; //store if alias found $found_alias = false; //current page name $cur_page = $crumbs[$len-1]->title; //for each item in structure path foreach ($structure_path as $crumb){ //if it is the current page if($crumb['pageName'] == $cur_page){ if ($crumb['page_alias'] != "" ){ $ret .= htmlentities(tra(($crumb['page_alias']))).'</a>'; $found_alias = true; } } } if (!$found_alias){ $ret .= htmlentities(tra($crumbs[$len-1]->title), ENT_QUOTES, 'UTF-8').'</a>'; } }


Note:
This change affects the following:
When tiki loads the page, calls breadcrumblib to generate the page title, and it says "return the crumb object's title attribute" (which is pageName), this code says "before returning the title attribute, check if the page has an alias and if it does return that instead". A better approach might be to fix wherever the title attribute is being generated, and set it to the alias, if that doesn't cause problems for other things.

The code here is the same between tiki 11 and 10 (may want to verify), meaning that this is not the actual cause of the problem (as the regression appears in tiki 11). However, other changes have been made to the file, and I didn't have the time to hunt down the central issue and then test to make sure modifying it wouldn't mess with those other changes, so I just duct taped it here.

Importance
8
Priority
40
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
4722
Created
Thursday 05 September, 2013 19:19:42 UTC
by jcarter
LastModif
Saturday 19 October, 2013 23:06:23 UTC


Show PHP error messages