From 6b1d25fb1a4a03967e866360ba78004619711a52 Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Tue, 27 Mar 2018 02:55:24 +0100 Subject: [PATCH 1/6] Make sure items is an array. Resolved #19998 --- components/com_tags/views/tag/tmpl/default_items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/com_tags/views/tag/tmpl/default_items.php b/components/com_tags/views/tag/tmpl/default_items.php index 87cb5e4aab90d..dcbf5c09efa1f 100644 --- a/components/com_tags/views/tag/tmpl/default_items.php +++ b/components/com_tags/views/tag/tmpl/default_items.php @@ -22,7 +22,7 @@ $canEdit = $user->authorise('core.edit', 'com_tags'); $canCreate = $user->authorise('core.create', 'com_tags'); $canEditState = $user->authorise('core.edit.state', 'com_tags'); -$items = $this->items; +$items = is_array($this->items) ? $this->items : (array) $this->items; $n = count($this->items); JFactory::getDocument()->addScriptDeclaration(" From 2ed0ecd9632f702159808e17de432185708d6a97 Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Tue, 27 Mar 2018 11:57:41 +0100 Subject: [PATCH 2/6] Update default_items.php --- components/com_tags/views/tag/tmpl/default_items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/com_tags/views/tag/tmpl/default_items.php b/components/com_tags/views/tag/tmpl/default_items.php index dcbf5c09efa1f..87cb5e4aab90d 100644 --- a/components/com_tags/views/tag/tmpl/default_items.php +++ b/components/com_tags/views/tag/tmpl/default_items.php @@ -22,7 +22,7 @@ $canEdit = $user->authorise('core.edit', 'com_tags'); $canCreate = $user->authorise('core.create', 'com_tags'); $canEditState = $user->authorise('core.edit.state', 'com_tags'); -$items = is_array($this->items) ? $this->items : (array) $this->items; +$items = $this->items; $n = count($this->items); JFactory::getDocument()->addScriptDeclaration(" From 4f5077f0bd66f7cff601f9ecbe7207279db78dca Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Tue, 27 Mar 2018 11:59:19 +0100 Subject: [PATCH 3/6] Update tag.php --- components/com_tags/models/tag.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/com_tags/models/tag.php b/components/com_tags/models/tag.php index 9eecc42e93036..7d9814eabc79e 100644 --- a/components/com_tags/models/tag.php +++ b/components/com_tags/models/tag.php @@ -87,6 +87,11 @@ public function getItems() if (!empty($items)) { + if(!is_array($items)) + { + $items = (array) $items; + } + foreach ($items as $item) { $explodedTypeAlias = explode('.', $item->type_alias); From 5c5836fd5b67ad421041e6607326a5e528b9937c Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Tue, 27 Mar 2018 16:58:35 +0100 Subject: [PATCH 4/6] Update tag.php --- components/com_tags/models/tag.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/com_tags/models/tag.php b/components/com_tags/models/tag.php index 7d9814eabc79e..1574cc878c64c 100644 --- a/components/com_tags/models/tag.php +++ b/components/com_tags/models/tag.php @@ -115,13 +115,9 @@ public function getItems() break; } } - - return $items; - } - else - { - return false; } + + return $items; } /** From 78c6f9ea9762a2a40d51a81dede504a1904f5a44 Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Tue, 27 Mar 2018 16:58:54 +0100 Subject: [PATCH 5/6] Update tag.php --- components/com_tags/models/tag.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/com_tags/models/tag.php b/components/com_tags/models/tag.php index 1574cc878c64c..3847637a21dd7 100644 --- a/components/com_tags/models/tag.php +++ b/components/com_tags/models/tag.php @@ -87,11 +87,6 @@ public function getItems() if (!empty($items)) { - if(!is_array($items)) - { - $items = (array) $items; - } - foreach ($items as $item) { $explodedTypeAlias = explode('.', $item->type_alias); From bf43a16207dabf67cae5cfe01030825217afd534 Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Tue, 27 Mar 2018 21:12:50 +0100 Subject: [PATCH 6/6] Update tag.php --- components/com_tags/models/tag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/com_tags/models/tag.php b/components/com_tags/models/tag.php index 3847637a21dd7..80247d44bc000 100644 --- a/components/com_tags/models/tag.php +++ b/components/com_tags/models/tag.php @@ -111,7 +111,7 @@ public function getItems() } } } - + return $items; }