Skip to content

Commit

Permalink
Merge pull request #8674 from wilsonge/toString
Browse files Browse the repository at this point in the history
Typecast queries rather than use the magic PHP method
  • Loading branch information
Michael Babker committed Apr 12, 2016
2 parents e7cf48a + 1377d6c commit 6043ab9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/com_banners/models/banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function getListQuery()
->where('sub.level <= this.level + ' . $levels);

// Add the subquery to the main query
$query->where('(' . $categoryEquals . ' OR a.catid IN (' . $subQuery->__toString() . '))');
$query->where('(' . $categoryEquals . ' OR a.catid IN (' . (string) $subQuery . '))');
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/models/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ protected function getListQuery()
}

// Add the subquery to the main query
$query->where('(' . $categoryEquals . ' OR a.catid IN (' . $subQuery->__toString() . '))');
$query->where('(' . $categoryEquals . ' OR a.catid IN (' . (string) $subQuery . '))');
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/user/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public function getAuthorisedCategories($component, $action)

$query = $db->getQuery(true)
->select('c.id AS id, a.name AS asset_name')
->from('(' . $subQuery->__toString() . ') AS c')
->from('(' . (string) $subQuery . ') AS c')
->join('INNER', '#__assets AS a ON c.asset_id = a.id');
$db->setQuery($query);
$allCategories = $db->loadObjectList('id');
Expand Down

0 comments on commit 6043ab9

Please sign in to comment.