Skip to content

Commit

Permalink
Fixed instance hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
smz committed Dec 13, 2014
1 parent d9e2c0b commit f432d36
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libraries/legacy/categories/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public function __construct($options)
$options['access'] = (isset($options['access'])) ? $options['access'] : 'true';
$options['published'] = (isset($options['published'])) ? $options['published'] : 1;
$options['countItems'] = (isset($options['countItems'])) ? $options['countItems'] : 0;
$options['currentlang'] = (isset($options['currentlang'])) ? (JLanguageMultilang::isEnabled() ? $options['currentlang'] : 0) : 0;
$options['currentlang'] = (isset($options['currentlang']) && JLanguageMultilang::isEnabled()) ? $options['currentlang'] : 0;
if ($options['currentlang'] == 1)
{
$options['currentlang'] = JFactory::getLanguage()->getTag();
}
$this->_options = $options;

return true;
Expand Down Expand Up @@ -261,7 +265,7 @@ protected function _load($id)
->where('badcats.id is null');

// Note: i for item
if ($this->_options['currentlang'] == 1 || $this->_options['countItems'] == 1)
if ($this->_options['currentlang'] != 0 || $this->_options['countItems'] == 1)
{
$queryjoin = $db->quoteName($this->_table) . ' AS i ON i.' . $db->quoteName($this->_field) . ' = c.id';

Expand All @@ -270,9 +274,9 @@ protected function _load($id)
$queryjoin .= ' AND i.' . $this->_statefield . ' = 1';
}

if ($this->_options['currentlang'] == 1)
if ($this->_options['currentlang'] != 0)
{
$queryjoin .= ' AND (i.language = \'*\' OR i.language = ' . $db->quote(JFactory::getLanguage()->getTag()) . ')';
$queryjoin .= ' AND (i.language = \'*\' OR i.language = ' . $db->quote($this->_options['currentlang']) . ')';
}

$query->join('LEFT', $queryjoin);
Expand Down

0 comments on commit f432d36

Please sign in to comment.