Skip to content

Commit

Permalink
media_service: Count-Query ohne Order-By (#6001)
Browse files Browse the repository at this point in the history
Co-authored-by: Gregor Harlan <mail@gh01.de>
  • Loading branch information
tbaddade and gharlan committed Mar 8, 2024
1 parent b1733a8 commit 0744682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redaxo/src/addons/mediapool/lib/service_media.php
Expand Up @@ -343,10 +343,10 @@ public static function getList(array $filter = [], array $orderBy = [], ?rex_pag
}

if ($pager) {
$query .= ' ORDER BY ' . implode(', ', $orderbys);
$sql->setQuery(str_replace('SELECT m.filename', 'SELECT count(*)', $query), $queryParams);
$pager->setRowCount((int) $sql->getValue('count(*)'));

$query .= ' ORDER BY ' . implode(', ', $orderbys);
$query .= ' LIMIT ' . $pager->getCursor() . ',' . $pager->getRowsPerPage();
}

Expand Down

0 comments on commit 0744682

Please sign in to comment.