diff --git a/CHANGELOG.md b/CHANGELOG.md index c56d794ea5f..17f536c94a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Craft CMS 4 +## Unreleased + +- Fixed a bug where `craft\db\QueryBatcher::getSlice()` wasn’t using the database connection passed to the class constructor. ([#16579](https://github.com/craftcms/cms/issues/16579)) + ## 4.14.2 - 2025-01-28 - Fixed a bug where Entries fields’ entry select modals could show expand/collapse toggles for Structure sections, for elements that didn’t have any selectable descendants. ([#16506](https://github.com/craftcms/cms/issues/16506)) diff --git a/src/db/QueryBatcher.php b/src/db/QueryBatcher.php index d48af22f7c6..5fb71c1f4b6 100644 --- a/src/db/QueryBatcher.php +++ b/src/db/QueryBatcher.php @@ -82,7 +82,7 @@ public function getSlice(int $offset, int $limit): iterable $slice = $query ->offset((is_int($queryOffset) ? $queryOffset : 0) + $offset) ->limit($limit) - ->all(); + ->all($this->db); } catch (QueryAbortedException) { $slice = []; }