Fix errors on other pages with titles not in a markup render item

This commit is contained in:
benjamin melançon 2019-10-04 09:31:20 -04:00
parent 9a0f2e22e6
commit 77bc63c43e

View file

@ -5,6 +5,10 @@
*/ */
function geofresco_preprocess_page_title(&$variables) { function geofresco_preprocess_page_title(&$variables) {
// WE SHALL BE SHAMELESS. // WE SHALL BE SHAMELESS.
if (!isset($variables['title']) || !is_array($variables['title'])) {
// The pages we're interested in have title as markup, so bail if it's not.
return;
}
$string = isset($variables['title']['#markup']) ? $variables['title']['#markup'] : FALSE; $string = isset($variables['title']['#markup']) ? $variables['title']['#markup'] : FALSE;
if ($string && $pos = strpos($string, "'s blog", -7)) { if ($string && $pos = strpos($string, "'s blog", -7)) {
$uid = substr($string, 0, $pos); $uid = substr($string, 0, $pos);