From cae8cf13458a774728ce128c102f0d545b8711df Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 18 Feb 2021 17:02:37 -0800 Subject: [PATCH] Fixes #4398 - Page breadcrumb. Disabled breadcrumb on frontpage. --- e107_core/shortcodes/batch/page_shortcodes.php | 17 +++++++++++++++-- e107_handlers/form_handler.php | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index c10c6434e..dad5d6fff 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -24,6 +24,7 @@ class cpage_shortcodes extends e_shortcode // var $var; // parsed DB values private $chapterData = array(); private $cpageFieldName = null; + private $breadcrumbComplete = false; // Grab all book/chapter data. function __construct() @@ -658,21 +659,33 @@ class cpage_shortcodes extends e_shortcode { $breadcrumb = array(); + $request = e107::getRegistry('core/page/request'); + $action = varset($request['action']); + $row = $this->getChapter(); $brow = $this->getBook($row['chapter_parent']); - if(empty($brow['chapter_sef'])) + if(empty($brow['chapter_sef']) || $this->breadcrumbComplete === true || ($action === 'listBooks')) { //e107::getDebug()->log($this); return null; } + $row['book_sef'] = vartrue($brow['chapter_sef'],"no-sef-found"); //$this->getBook(); $breadcrumb[] = array('text'=> $brow['chapter_name'], 'url'=> e107::getUrl()->create('page/book/index', $brow,'allow=chapter_id,chapter_sef,book_sef,page_sef')); - $breadcrumb[] = array('text'=> $row['chapter_name'], 'url'=> e107::getUrl()->create('page/chapter/index', $row,'allow=chapter_id,chapter_sef,book_sef')); + + if($action !== 'listChapters') + { + $breadcrumb[] = array('text'=> $row['chapter_name'], 'url'=> e107::getUrl()->create('page/chapter/index', $row,'allow=chapter_id,chapter_sef,book_sef')); + } + + + e107::breadcrumb($breadcrumb); + $this->breadcrumbComplete = true; } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 9473ad2d0..8c8e310b0 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -3632,6 +3632,11 @@ var_dump($select_options);*/ return null; } + if(deftrue('e_FRONTPAGE')) + { + return null; + } + if(!is_array($array)){ return; } $opt = array();