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 c83d6c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
?>

<div id="joomlaupdate-wrapper">
<form enctype="multipart/form-data" action="index.php" method="post" id="adminForm" class="form-horizontal">

<?php if ($this->showUploadAndUpdate) : ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'joomlaupdate-tabs', array('active' => 'online-update')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'joomlaupdate-tabs', 'online-update', JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_TAB_ONLINE')); ?>
<?php endif; ?>
<?php if ($this->showUploadAndUpdate) : ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'joomlaupdate-tabs', array('active' => 'online-update')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'joomlaupdate-tabs', 'online-update', JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_TAB_ONLINE')); ?>
<?php endif; ?>

<form enctype="multipart/form-data" action="index.php" method="post" id="adminForm" class="form-horizontal">

<?php if ($this->selfUpdate) : ?>
<?php // If we have a self update notice to install it first! ?>
Expand Down
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 c83d6c4

Please sign in to comment.