Skip to content

Commit

Permalink
Fix too many parameters
Browse files Browse the repository at this point in the history
MySQL acccepts at most 65535 parameters, so it is important to use a `where` clause here.
  • Loading branch information
bencroker committed Mar 9, 2024
1 parent 57e808a commit 6a3f170
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/services/SegmentsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6a3f170

Please sign in to comment.