Skip to content

Commit

Permalink
Replace $query->count() with count($query->all())
Browse files Browse the repository at this point in the history
Yii's $query->count() [ignores things like limit and
offset](yiisoft/yii2#13846).

Fixes #12526
  • Loading branch information
brianjhanson committed Jan 13, 2023
1 parent b6dd0c1 commit 861580e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/console/controllers/ResaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ private function _resaveElements(ElementQueryInterface $query): int
/** @var ElementQuery $query */
/** @var ElementInterface $elementType */
$elementType = $query->elementType;
$count = (int)$query->count();
$count = count($query->all());

if ($count === 0) {
$this->stdout('No ' . $elementType::pluralLowerDisplayName() . ' exist for that criteria.' . PHP_EOL, Console::FG_YELLOW);
Expand Down

0 comments on commit 861580e

Please sign in to comment.