diff --git a/components/com_content/Model/ArticleModel.php b/components/com_content/Model/ArticleModel.php index dafa7d6d01cf6..5d80777972ba9 100644 --- a/components/com_content/Model/ArticleModel.php +++ b/components/com_content/Model/ArticleModel.php @@ -115,7 +115,8 @@ public function getItem($pk = null) ->where($db->quoteName('wa.stage_id') . ' = ' . $db->quoteName('ws.id')); // Join on category table. - $query->select('c.title AS category_title, c.alias AS category_alias, c.access AS category_access') + $query->select('c.title AS category_title, c.alias AS category_alias, c.access AS category_access,' . + 'c.language AS category_language') ->innerJoin('#__categories AS c on c.id = a.catid') ->where('c.published > 0'); @@ -130,7 +131,8 @@ public function getItem($pk = null) } // Join over the categories to get parent category titles - $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias') + $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route,' . + 'parent.alias as parent_alias, parent.language as parent_language') ->join('LEFT', '#__categories as parent ON parent.id = c.parent_id'); // Join on voting table diff --git a/components/com_content/Model/ArticlesModel.php b/components/com_content/Model/ArticlesModel.php index c8d4fc0d3899f..b5791b7bba5cd 100644 --- a/components/com_content/Model/ArticlesModel.php +++ b/components/com_content/Model/ArticlesModel.php @@ -251,7 +251,8 @@ protected function getListQuery() ->join('LEFT', '#__workflow_stages AS ws ON ws.id = wa.stage_id'); // Join over the categories. - $query->select('c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias') + $query->select('c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,' . + 'c.language AS category_language') ->select('c.published, c.published AS parents_published, c.lft') ->join('LEFT', '#__categories AS c ON c.id = a.catid'); @@ -262,7 +263,8 @@ protected function getListQuery() ->join('LEFT', '#__users AS uam ON uam.id = a.modified_by'); // Join over the categories to get parent category titles - $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias') + $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,' . + 'parent.language as parent_language') ->join('LEFT', '#__categories as parent ON parent.id = c.parent_id'); if (PluginHelper::isEnabled('content', 'vote')) diff --git a/components/com_content/View/Archive/HtmlView.php b/components/com_content/View/Archive/HtmlView.php index cceb8a2e931f3..0199194a6958e 100644 --- a/components/com_content/View/Archive/HtmlView.php +++ b/components/com_content/View/Archive/HtmlView.php @@ -115,13 +115,12 @@ public function display($tpl = null) foreach ($items as $item) { - $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; - $item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; + $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; // No link for ROOT category if ($item->parent_alias === 'root') { - $item->parent_slug = null; + $item->parent_id = null; } $item->event = new \stdClass; diff --git a/components/com_content/View/Article/HtmlView.php b/components/com_content/View/Article/HtmlView.php index 8154b7200d664..f72203c8eef54 100644 --- a/components/com_content/View/Article/HtmlView.php +++ b/components/com_content/View/Article/HtmlView.php @@ -107,14 +107,12 @@ public function display($tpl = null) $item->tagLayout = new FileLayout('joomla.content.tags'); // Add router helpers. - $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; - $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; - $item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; + $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; // No link for ROOT category if ($item->parent_alias === 'root') { - $item->parent_slug = null; + $item->parent_id = null; } // TODO: Change based on shownoauth @@ -302,7 +300,7 @@ protected function _prepareDocument() while ($category && ($menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article' || $id != $category->id) && $category->id > 1) { - $path[] = array('title' => $category->title, 'link' => \ContentHelperRoute::getCategoryRoute($category->id)); + $path[] = array('title' => $category->title, 'link' => \ContentHelperRoute::getCategoryRoute($category->id, $category->language)); $category = $category->getParent(); } diff --git a/components/com_content/View/Category/HtmlView.php b/components/com_content/View/Category/HtmlView.php index 940d41eda9f5e..ce2360b57464c 100644 --- a/components/com_content/View/Category/HtmlView.php +++ b/components/com_content/View/Category/HtmlView.php @@ -95,15 +95,12 @@ public function display($tpl = null) { $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; - $item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; - // No link for ROOT category if ($item->parent_alias === 'root') { - $item->parent_slug = null; + $item->parent_id = null; } - $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; $item->event = new \stdClass; // Old plugins: Ensure that text property is available @@ -290,7 +287,7 @@ protected function prepareDocument() while (($menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article' || $id != $category->id) && $category->id > 1) { - $path[] = array('title' => $category->title, 'link' => \ContentHelperRoute::getCategoryRoute($category->id)); + $path[] = array('title' => $category->title, 'link' => \ContentHelperRoute::getCategoryRoute($category->id, $category->language)); $category = $category->getParent(); } diff --git a/components/com_content/View/Featured/HtmlView.php b/components/com_content/View/Featured/HtmlView.php index dde1f0768b040..e82bb2bd707f8 100644 --- a/components/com_content/View/Featured/HtmlView.php +++ b/components/com_content/View/Featured/HtmlView.php @@ -140,14 +140,12 @@ public function display($tpl = null) // Compute the article slugs and prepare introtext (runs content plugins). foreach ($items as &$item) { - $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; - $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; - $item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; + $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; // No link for ROOT category if ($item->parent_alias === 'root') { - $item->parent_slug = null; + $item->parent_id = null; } $item->event = new \stdClass; diff --git a/components/com_content/helpers/route.php b/components/com_content/helpers/route.php index 6878b9def2bcf..f5dfb96dadc17 100644 --- a/components/com_content/helpers/route.php +++ b/components/com_content/helpers/route.php @@ -81,14 +81,6 @@ public static function getCategoryRoute($catid, $language = 0) { $link .= '&lang=' . $language; } - - $jinput = JFactory::getApplication()->input; - $layout = $jinput->get('layout'); - - if ($layout !== '') - { - $link .= '&layout=' . $layout; - } } return $link; diff --git a/components/com_content/tmpl/archive/default_items.php b/components/com_content/tmpl/archive/default_items.php index 7a02d9e6e022e..f0c5857c51483 100644 --- a/components/com_content/tmpl/archive/default_items.php +++ b/components/com_content/tmpl/archive/default_items.php @@ -55,12 +55,15 @@ - get('show_parent_category') && !empty($item->parent_slug)) : ?> + get('show_parent_category') && !empty($item->parent_id)) : ?>