Skip to content

Commit

Permalink
Fixes #982
Browse files Browse the repository at this point in the history
Sorting preference is not taken into account when getting content by taxonomy
  • Loading branch information
flrvt committed Mar 13, 2014
1 parent 32d02bd commit 9c76825
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/Bolt/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ public function getContentByTaxonomy($taxonomyslug, $name, $parameters = "")
$slug = makeSlug($name);

$limit = $parameters['limit'] ? : 100;
$order = $parameters['order'] ? : 'id ASC';
$page = $parameters['page'] ? : 1;

$taxonomytype = $this->getTaxonomyType($taxonomyslug);
Expand All @@ -1198,7 +1199,7 @@ public function getContentByTaxonomy($taxonomyslug, $name, $parameters = "")
$pagerquery = "SELECT COUNT(*) AS count FROM $tablename" . $where;

// Add the limit
$query = "SELECT * FROM $tablename" . $where . " ORDER BY id DESC";
$query = "SELECT * FROM $tablename" . $where . " ORDER BY " . $order;
$query = $this->app['db']->getDatabasePlatform()->modifyLimitQuery($query, $limit, ($page - 1) * $limit);

$taxorows = $this->app['db']->fetchAll($query);
Expand Down

0 comments on commit 9c76825

Please sign in to comment.