Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Dec 2010 at 20:00 UTC
Updated:
15 Mar 2011 at 11:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
das-peter commentedJust had a good chat with DamZ about this issue.
It seems that conditions never were thought to be arrays.
Here the main arguments from DamZ why we should review this implementation:
EntityAPIController::applyConditions()doesn't support it::buildQuery()supports it by chanceAtm. the array values shouldn't have a negative affect since the two conditions, that could contain an array as value, are unset before the other conditions are passed to the parent implementation of
applyConditions().Since I'm not feeling competent enough to make a decision here, and I'm just happy to see my default rule set now, no patch is attached. :)
Comment #2
fagoOh I see, that code didn't work with arrays. :/
Using EntityFieldQuery() doesn't work in that case, as rules may be defined in code - thus the EntityFieldQuery would miss those. entity API could provide an EntityFieldQuery implementation taking care of that - however I'm not sure whether that's the way to go. See #1008810: Store all exportables in the db.
Anyway, as of now your patch makes sense, but
if(isset(doesn't comply to the coding standards.Comment #3
das-peter commentedDamn, 4 lines of code and I manage it to mess it up :)
Comment #4
fagohehe, thanks committed. :)
Comment #5
fagoLooking at this again, I think this is a bug in the entity API:
db conditions work like that:
However the logic used for applying conditions to cached entities doesn't default to IN for arrays.
Comment #6
fago>However the logic used for applying conditions to cached entities doesn't default to IN for arrays.
As noted in #1081902-11: DrupalEntityControllerInterface::load - doc needs to clarify $conditions I think we have the same problem in core, thus assigning to core.
From looking at the logic entity_load() it would continue with loading the entity from the DB in that case though.
>Just had a good chat with DamZ about this issue.
>It seems that conditions never were thought to be arrays.
I agree that this might be an "unintentional" feature, but removing it right now might break some existing code.
Comment #7
damien tournoud commentedThere is no such thing. The documentation for $conditions never stated that the values can themselves be arrays.