From f9bfcec8d9b02c7bf6442f64176057ea817b85c9 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Sat, 16 Jun 2018 03:46:18 +0300 Subject: [PATCH] [com_tags] Tagged item link in feed (#20723) * [com_tags] Tagged item feed links * Nesting error --- components/com_tags/models/tag.php | 11 +++++-- .../com_tags/views/tag/tmpl/default_items.php | 30 ++++++++----------- .../com_tags/views/tag/tmpl/list_items.php | 11 +++---- components/com_tags/views/tag/view.feed.php | 6 +--- 4 files changed, 26 insertions(+), 32 deletions(-) diff --git a/components/com_tags/models/tag.php b/components/com_tags/models/tag.php index 147fb333fc7f3..eb7d8ee528167 100644 --- a/components/com_tags/models/tag.php +++ b/components/com_tags/models/tag.php @@ -89,9 +89,14 @@ public function getItems() { foreach ($items as $item) { - $explodedTypeAlias = explode('.', $item->type_alias); - $item->link = 'index.php?option=' . $explodedTypeAlias[0] . '&view=' . $explodedTypeAlias[1] . '&id=' - . $item->content_item_id . ':' . $item->core_alias; + $item->link = TagsHelperRoute::getItemRoute( + $item->content_item_id, + $item->core_alias, + $item->core_catid, + $item->core_language, + $item->type_alias, + $item->router + ); // Get display date switch ($this->state->params->get('tag_list_show_date')) diff --git a/components/com_tags/views/tag/tmpl/default_items.php b/components/com_tags/views/tag/tmpl/default_items.php index 87cb5e4aab90d..b5fb3edbb29af 100644 --- a/components/com_tags/views/tag/tmpl/default_items.php +++ b/components/com_tags/views/tag/tmpl/default_items.php @@ -9,8 +9,6 @@ defined('_JEXEC') or die; -JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); - JHtml::_('behavior.core'); JHtml::_('formbehavior.chosen', 'select'); @@ -22,8 +20,6 @@ $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; -$n = count($this->items); JFactory::getDocument()->addScriptDeclaration(" var resetFilter = function() { @@ -64,32 +60,32 @@
- items === false || $n === 0) : ?> + items)) : ?>