From 77bc63c43e0a3cffd6a947b6a180cbba70fd2540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Fri, 4 Oct 2019 09:31:20 -0400 Subject: [PATCH] Fix errors on other pages with titles not in a markup render item --- web/themes/custom/geofresco/geofresco.theme | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/themes/custom/geofresco/geofresco.theme b/web/themes/custom/geofresco/geofresco.theme index e6b72fe..ee2fe5d 100644 --- a/web/themes/custom/geofresco/geofresco.theme +++ b/web/themes/custom/geofresco/geofresco.theme @@ -5,6 +5,10 @@ */ function geofresco_preprocess_page_title(&$variables) { // 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; if ($string && $pos = strpos($string, "'s blog", -7)) { $uid = substr($string, 0, $pos);