Skip to content

Commit

Permalink
Merge pull request #1550 from craftcms/bugfix/1530-limit-categories-s…
Browse files Browse the repository at this point in the history
…earch-by-group

limit the search for categories by `groupId`
  • Loading branch information
angrybrad authored Nov 27, 2024
2 parents 89d0a96 + e926c97 commit db4960c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fields/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ public function parseField(): mixed
$columnName = Craft::$app->getFields()->oldFieldColumnPrefix . $match;
}

if ($groupId) {
$criteria['groupId'] = $groupId;
}
$criteria['status'] = null;
$criteria['limit'] = $limit;
$criteria['where'] = ['=', $columnName, $dataValue];
Expand Down

0 comments on commit db4960c

Please sign in to comment.