API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%...

Says "This method can take a variable number of parameters. If called with two parameters, they are taken as $field and $value with $operator having a value of IN if $value is an array and = otherwise."

That is no longer true because of the changes described in the change record Require a specific placeholder format in db_query() in order to trigger argument expansion, and require explicit 'IN' parameter for conditions

Specifically, IN is never assumed, and if you pass an array as the $value without specifying IN as the $operator you will get a database exception.

CommentFileSizeAuthor
#3 2463363-3.patch703 bytesrpayanm

Comments

jhodgdon’s picture

Dang. Sounds like that documentation should have been fixed on the parent issue, according to the Documentation Gate. So let's fix it now!

jhodgdon’s picture

Issue tags: +Novice
rpayanm’s picture

Status: Active » Needs review
StatusFileSize
new703 bytes
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Straightforward enough!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed daf9e2c and pushed to 8.0.x. Thanks!

  • alexpott committed daf9e2c on 8.0.x
    Issue #2463363 by rpayanm: ConditionInterface::condition docmentation...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.