Skip to content

Commit

Permalink
Delete unnecesary catslug query from mod_related_items (#8946)
Browse files Browse the repository at this point in the history
* Delete unnecesary catslug from mod_related_items

* remove whitespace

* catslug depricated note

* start comment with a capital letter

* add blank line

* Update helper.php

* Update helper.php
  • Loading branch information
shur authored and roland-d committed Nov 13, 2016
1 parent af98a75 commit 90d218b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions modules/mod_related_items/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,7 @@ public static function getList(&$params)
$case_when .= $query->concatenate(array($a_id, 'a.alias'), ':');
$case_when .= ' ELSE ';
$case_when .= $a_id . ' END as slug';
$query->select($case_when);

$case_when = ' CASE WHEN ';
$case_when .= $query->charLength('cc.alias', '!=', '0');
$case_when .= ' THEN ';
$c_id = $query->castAsChar('cc.id');
$case_when .= $query->concatenate(array($c_id, 'cc.alias'), ':');
$case_when .= ' ELSE ';
$case_when .= $c_id . ' END as catslug';
$query->select($case_when)
->from('#__content AS a')
->join('LEFT', '#__content_frontpage AS f ON f.content_id = a.id')
Expand Down Expand Up @@ -188,9 +180,11 @@ public static function getList(&$params)
foreach ($related as &$item)
{
$item->slug = $item->id . ':' . $item->alias;

/** @deprecated Catslug is deprecated, use catid instead. 4.0 **/
$item->catslug = $item->catid . ':' . $item->category_alias;

$item->route = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
$item->route = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
}
}

Expand Down

0 comments on commit 90d218b

Please sign in to comment.