From 09cb768d553a39fa2c8896d78a642398247793d5 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Sat, 6 Oct 2018 12:13:45 +0200 Subject: [PATCH] [staging fix] Class 'ContentHelperAssociation' not found when editing a module in frontend --- components/com_content/models/articles.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/com_content/models/articles.php b/components/com_content/models/articles.php index d93ccc0f6dc60..f35a89b8019f3 100644 --- a/components/com_content/models/articles.php +++ b/components/com_content/models/articles.php @@ -13,6 +13,8 @@ use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; +JLoader::register('ContentHelperAssociation', JPATH_SITE . '/components/com_content/helpers/association.php'); + /** * This models supports retrieving lists of articles. * @@ -246,13 +248,13 @@ protected function getListQuery() if (JPluginHelper::isEnabled('content', 'vote')) { // Join on voting table - $query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating, + $query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating, COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count') ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id'); } // Filter by access level. - if ($this->getState('filter.access', true)) + if ($this->getState('filter.access', true)) { $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ')')