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
- 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.phpchanging the code fromCopy 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+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 4722
- Created
- Thursday 05 September, 2013 19:19:42 UTC
by jcarter - LastModif
- Saturday 19 October, 2013 23:06:23 UTC