diff --git a/CHANGELOG.md b/CHANGELOG.md index 722c292d..9f978ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ - Campaign now requires Craft CMS 4.4.0 or later. +### Fixed + +- Fixed a bug in which an error could be thrown when very large numbers of contacts were being filtered by segments. + ### Deprecated - Deprecated the `memoryLimit` config setting. diff --git a/src/services/SegmentsService.php b/src/services/SegmentsService.php index cd95f6d7..4b99d940 100755 --- a/src/services/SegmentsService.php +++ b/src/services/SegmentsService.php @@ -285,7 +285,7 @@ private function _getContactElementQuery(array $contactIds = null): ContactEleme $contactQuery = ContactElement::find(); if ($contactIds !== null) { - $contactQuery->id($contactIds); + $contactQuery->andWhere(['contactId' => $contactIds]); } return $contactQuery;