From c40c90929377863fca9537d89770731d43fcfa5c Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 28 Apr 2016 18:13:41 -0700 Subject: [PATCH] Fix for news params in news shortcodes. --- e107_core/shortcodes/batch/news_shortcodes.php | 11 ++++++++--- e107_handlers/shortcode_handler.php | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 31171cc0c..ece42fd0a 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -35,7 +35,7 @@ class news_shortcodes extends e_shortcode private $imageItem; - public $param = array(); + // protected $param; // do not enable - erases param. . function __construct($eVars = null) @@ -381,11 +381,16 @@ class news_shortcodes extends e_shortcode if($this->commentsDisabled || ($this->commentsEngine != 'e107')) { - return; + return null; } $class = varset($parm['class']) ? " ".$parm['class'] : ""; + if(empty($this->param['commentlink'])) + { + $this->param['commentlink'] = e107::getParser()->toGlyph('fa-comment'); + } + // When news_allow_comments = 1 then it is disabled. Backward, but that's how it is in v1.x $text = ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "news_item)."'>".$this->param['commentlink'].''); return $text; @@ -398,7 +403,7 @@ class news_shortcodes extends e_shortcode { if($this->commentsDisabled || ($this->commentsEngine != 'e107')) { - return; + return null; } $text = varset($parm['glyph']) ? e107::getParser()->toGlyph($parm['glyph']) : ""; diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index eda258861..197996ffa 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -1357,9 +1357,9 @@ class e_shortcode /** * e_shortcode constructor. */ - public function __construct() + public function __construct($eVars = null) { - $this->scVars = new e_vars(); + $this->scVars = !empty($eVars) ? $eVars : new e_vars(); } /**