Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Change
if ($bundles = $this->getBundles()) {
$query->condition($this->getBundleKey(), $bundles);
}
to
if ($bundles = $this->getBundles()) {
$query->condition($this->getBundleKey(), $bundles, 'IN');
}
or it will throw
"Invalid parameter number: number of bound variables does not match number of tokens ..."
Comment | File | Size | Author |
---|---|---|---|
#2 | feeds-2790105-entityreference-findentity-error.patch | 633 bytes | Andreas Radloff |
|
Comments
Comment #2
Andreas Radloff CreditAttribution: Andreas Radloff commentedComment #3
Andreas Radloff CreditAttribution: Andreas Radloff commentedComment #5
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedIn D7 the database API automatically adds the "IN" keyword if the value is an array, but it appears that D8 no longer does this. This was changed in in #2358079: Require a specific placeholder format in db_query() in order to trigger argument expansion, and require explicit 'IN' parameter for conditions.
Committed #2.
Additionally, found one more query where the "IN" keywords needs to be added. Committed this change as well.
Thanks for reporting and fixing!