From 88f8e6ab7ade344db0110f344f427c7933269f4c Mon Sep 17 00:00:00 2001 From: Septdir Date: Tue, 24 Apr 2018 21:45:18 +0300 Subject: [PATCH] Remove query --- components/com_content/helpers/association.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/components/com_content/helpers/association.php b/components/com_content/helpers/association.php index cf8edc11bce70..e16c087d4ae1f 100644 --- a/components/com_content/helpers/association.php +++ b/components/com_content/helpers/association.php @@ -37,8 +37,6 @@ public static function getAssociations($id = 0, $view = null, $layout = null) $view = $view === null ? $jinput->get('view') : $view; $layout = $layout === null ? $jinput->get('layout', '', 'string') : $layout; $id = empty($id) ? $jinput->getInt('id') : $id; - $user = JFactory::getUser(); - $groups = implode(',', $user->getAuthorisedViewLevels()); if ($view === 'article') { @@ -55,20 +53,7 @@ public static function getAssociations($id = 0, $view = null, $layout = null) $arrId = explode(':', $item->id); $assocId = $arrId[0]; - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->qn('state')) - ->from($db->qn('#__content')) - ->where($db->qn('id') . ' = ' . (int) ($assocId)) - ->where('access IN (' . $groups . ')'); - $db->setQuery($query); - - $result = (int) $db->loadResult(); - - if ($result > 0) - { - $return[$tag] = ContentHelperRoute::getArticleRoute($item->id, (int) $item->catid, $item->language, $layout); - } + $return[$tag] = ContentHelperRoute::getArticleRoute($assocId, (int) $item->catid, $item->language, $layout); } }