From 2d43b87b81387446045e9ccfb787bd754c108d9b Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 4 Oct 2017 14:17:08 -0700 Subject: [PATCH] Page: Fix for {CPAGEFIELDTITLE: name=x} rendering. --- e107_core/shortcodes/batch/page_shortcodes.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index fd093e1bd..5b613e463 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -36,6 +36,8 @@ class cpage_shortcodes extends e_shortcode $this->chapterData[$id] = $row; + + } @@ -622,6 +624,7 @@ class cpage_shortcodes extends e_shortcode function sc_cpagefieldtitle($parm=null) { + if(empty($parm['name']) || empty($this->var['page_fields'])) { return null; @@ -631,6 +634,12 @@ class cpage_shortcodes extends e_shortcode $key = $parm['name']; + if(!empty($this->chapterData[$chap]['chapter_fields']) && is_string($this->chapterData[$chap]['chapter_fields'])) + { + $this->chapterData[$chap]['chapter_fields'] = e107::unserialize($this->chapterData[$chap]['chapter_fields']); + } + + if(!empty($this->chapterData[$chap]['chapter_fields'][$key]['title'])) { return $this->chapterData[$chap]['chapter_fields'][$key]['title'];