API page: http://api.drupal.org/api/drupal/includes--entity.inc/function/DrupalEnt...
Describe the problem you have found:
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | interdiff-1081902-20-23.txt | 1.07 KB | zealfire |
| #23 | revised-changed-in-entity-1081902-23.patch | 1.33 KB | zealfire |
| #20 | revised-changed-in-entity-1081902-20.patch | 1.32 KB | zealfire |
| #20 | interdiff-1081902-18-20.txt | 1.15 KB | zealfire |
| #18 | doc-needs-to-clarify--1081902-18.patch | 1.17 KB | zealfire |
Comments
Comment #1
jhodgdonWhat problem did you find that you want to point out here?
Comment #2
iccle commentedHmm i thought i posted my question here, apparently not, basically my question is regarding the documentation for the $conditions parameter,
$conditions An array of conditions in the form 'field' => $value.I assume that this means conditions of equality? ie, if i implement this class then i should allow for testing of equality on any fields i provide?, to what extent does the drupal framework use these conditions?Comment #3
jhodgdonYes, equality. We should probably make that clearer in the doc. Good project for a novice doc patch contributor...
Comment #4
iccle commentedThanks, and if only i knew how... and was not on a windows machine with unreliable patch...
Comment #5
iccle commentedWell i created an issue for a request to update the documentation, i hope i did it correctly ;)
http://drupal.org/node/1090210
Comment #6
jhodgdonThis issue here is already a request to update the documentation. We don't really need two. I've closed the other issue as a duplicate.
Comment #7
jhodgdonFrom that other issue -- suggested change is:
Aside from the spelling of corresponding, and I'm not sure about 'field' vs. $value, something like this makes sense. Still needs a patch...
By the way, it's definitely possible to make patches on Windows. I did it for several years, though I'm not using Windows at this time.... There are instructions in http://drupal.org/documentation/git and subpages
Comment #8
iccle commentedNice docs, thanks :}
Comment #9
drewish commentedWe should also update DrupalEntityControllerInterface::buildQuery since it has basically the same documentation.
What do people think about this? I felt it was important to make it clear that the conditions must be on the base table and are ANDed together.
Comment #10
jhodgdonThat looks reasonable to me. Just needs a patch...
Comment #11
fago>Values will be compared for equality.
That's not entirely true. If you pass an array as value, DB-TNG and so entity-load will default to use the operator IN for comparison.
In that regard I think core also suffers the problem I noted in #1008324-5: problem applying conditions with an array as value, thus cacheGet() would fail to apply the same condition. entity_load() would continue with loading the entity from the DB then, though.
Comment #12
damien tournoud commentedDebatable. As far as I know, it was never the intent of the Entity API to support array conditions. The fact that it works by chance when the hitting the DB query directly does not mean it is supported.
Also, we need to add there that
$conditionsis deprecated in favor ofEntityFieldQuery.Comment #13
starsinmypockets commentedIf folks can agree on the update I can roll the patch :)
Comment #14
fago>The fact that it works by chance when the hitting the DB query directly does not mean it is supported.
Indeed, but one really cannot know as it's un-documented. I think, fixing it to work like #9 makes sense as it makes things clear - but this might break some existing code...
Comment #15
star-szrIn D8, it looks like DrupalEntityControllerInterface::load has moved to EntityStorageControllerInterface::load, while DrupalEntityControllerInterface::buildQuery has moved to DatabaseStorageController::buildQuery.
Setting to active until we get a patch as per http://drupal.org/node/156119.
Comment #16
berdir#1184272: Remove deprecated $conditions support from entity controller removes conditions, but probably needs better docs as well.
Comment #17
filijonka commentedMoving this to D7 since in D8 we have removed conditions, the load function is now located in https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21... and https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
Comment #18
zealfire commentedSubmitting a patch taking into consideration comments 9 and 7.Now a further discussion can take place so as to decide what needs to be updated in this patch.
Thanks.
Comment #19
jhodgdonI am not sure why the current patch has two different versions of the documentation for those two different classes? Let's make them the same. Then we need to address #12 and suggest people use an entity query instead of these methods anyway.
Comment #20
zealfire commentedSubmitting the patch along with a interdiff file.Please review.
Thanks.
Comment #21
zealfire commentedComment #22
jhodgdonAlmost there!
The only problem I can see now is that EntityFieldQuery is a class, not a function. So I think I would say "... deprecated; use an EntityFieldQuery instead."; maybe you can come up with better wording? In any case, it shouldn't have () after it.
Comment #23
zealfire commentedSubmitting a patch with an interdiff file.Please review.
Thanks.
Comment #24
jhodgdonThis looks reasonable to me. Provisionally setting to RTBC pending any further reviews. Thanks!
Comment #27
filijonka commentedtestboot hickup setting rtbc per #24
Comment #28
jhodgdonThanks again! Committed to 7.x.