From 1cca064f0facf3ea1549e4a6f0bca81d151338f9 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 15 Jun 2019 16:55:13 -0700 Subject: [PATCH] Breadcrumb fallback fix. --- class2.php | 15 +++++++++++++++ e107_handlers/e107_class.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/class2.php b/class2.php index b66868aac..b1cb27235 100755 --- a/class2.php +++ b/class2.php @@ -975,6 +975,21 @@ if (!class_exists('e107table', false)) } + /** + * Return the first caption rendered with {SETSTYLE=default} or {SETSTYLE=main} + * @return |null + */ + public function getMainCaption() + { + if(isset($this->mainRenders[0]['caption'])) + { + return $this->mainRenders[0]['caption']; + } + + return null; + } + + function getMagicShortcodes() { $ret = array(); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index ab7901723..76096fa9c 100755 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -3370,7 +3370,7 @@ class e107 { return array(0=> array('text'=>PAGE_NAME, 'url'=>null)); } - elseif($caption = e107::getRender()->getPrimaryCaption()) // BC search for primary render caption + elseif($caption = e107::getRender()->getMainCaption()) // BC search for primary render caption { return array(0=> array('text'=>$caption, 'url'=>null)); }