Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2010 at 14:39 UTC
Updated:
4 Dec 2010 at 09:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
solotandem commentedPatch is attached.
Comment #2
moshe weitzman commentedI could go either way on this. It is helpful to tell folks that certain code paths are being phased out, especially when the alternative is already available.
Comment #3
bojanz commented+1.
Not sure I like the comments though:
Can we just say something shorter like:
Comment #4
jhodgdon+1 to bojanz's fixed wording. But... these are all new functions in Drupal 7. If $conditions is actually deprecated, is it too late to just remove it?
Comment #5
bojanz commentedI think it is (too late). Module porting is in full swing, no reason to kick the maintainers once again.
Of course, if anyone has proof that the $conditions param is largely unused (a grep of the CVS tree?) that would be a different story.
Comment #6
jhodgdonOK, no removal. Let's get the wording a bit better...
Comment #7
bojanz commentedUnified the param description, changed the EntityFieldQuery recommendation wording.
Comment #8
damien tournoud commentedWe need to clarify that those conditions apply to the columns of the base table. The field terminology here is just confusing.
Comment #9
bojanz commentedMade it match the $entity_type_load() docs.
I can make that "An array of conditions to match against the columns of the base table" through the code, if that's preferable.
Comment #10
jhodgdonField is the correct term for items in a database table, not columns, so please don't change the word field to column... but I agree it's a bit confusing.
Also, please make this wrap into one paragraph:
(move the sentence starting with "Use Entity..." up to the previous line and wrap to 80-character lines)
Hmmm...
What about this wording:
An associative array of conditions on the base table telling which users to load, where the keys are the database fields and the values are the values those fields must have.
(in this, "users" would be replaced by taxonomy terms etc. for the other functions)
Comment #11
bojanz commentedI like the keys&values explanation (much better), I'd just kill the "telling which users to load" part, it's kinda obvious if you're reading the docs for user_load, no?
So,
How does that sound?
Comment #12
jhodgdonfine with me...
Comment #13
jhodgdonOne other thing I just thought of though. Maybe since it's deprectated, the next sentence should say "Instead, it is preferable to use EntityFieldQuery..." to make the "instead" more prominent?
Comment #14
bojanz commentedThat sounds great.
I'll do a reroll, and then we're good to go.
Comment #15
bojanz commentedComment #16
bojanz commentedMissed a newline before @return in user.module
Comment #17
jhodgdonLooks OK to me. Thanks!
Comment #18
dries commentedMaybe we should add a // @todo: remove in D8 ?
Comment #19
bojanz commentedTo me, "deprecated" implies 'will be removed in Drupal 8".
Did a grep through the code, seems like this is the first time we are marking something deprecated (in other cases we just use the @todo remove in D8).
I can add "@todo Remove $conditions in Drupal 8" at the end of the doc block for each function, if that would do it.
Comment #20
dries commentedI agree that it could be implied -- I was merely suggesting to make it more explicit to be consistent.
I don't remember having any deprecated parameters but I'm OK with it. I'd also be OK with removing the parameter but that might require more discussion and investigation.
Comment #22
jhodgdonThat's interesting that this is the only usage of the word "deprecated" in Drupal 7.
It's also interesting that Dries might consider removing the parameter. chx and solotandem were apparently the instigators of this issue... hopefully they can comment about removal vs. documentation.
Regarding the @todo, putting that in is probably a good idea... Back in January, sun apparently added standards for @todo blocks to the doxygen standards:
http://drupal.org/node/1354
I am not sure why, since the API module doesn't actually do anything with @todo... and I'm not sure the standards make any sense to me, but if we have standards, they should be followed.
Comment #23
jhodgdonWe've had a discussion on standards for @todo by the way. Although nothing was resolved, the standards on the doxygen page remain the same:
#712876: Define coding standards for @todos
Comment #24
bojanz commentedDiscussed this with chx on IRC, and he's perfectly happy with just going with the docs patch (and not removing the param).
It's a small detail to argue about days before a Release Candidate, with dozen D7 books already out in the wild, referencing who knows what.
I'm a bit busy in the next few days, so if someone wants to do a reroll with the @todos before me, feel free to do so.
Comment #25
amateescu commentedRerolled with @todos.
Comment #26
amateescu commentedAdded a period at the of @todos. I seem to be missing that all the time :(
Comment #27
bojanz commentedLooks good.
Comment #28
webchickThis patch seems to imply that if I went over to http://api.scratch.drupal.org/api/drupal/includes--entity.inc/class/Enti... I would find an example of how to add conditions to queries without the use of the $conditions array. However, I do not.
Is it possible to expand the PHPDoc above that section to show some @code examples so that this problem would go away?
Comment #29
bojanz commentedWe agreed on IRC that EntityFieldQuery can be clarified in other issues / followups, and that we shouldn't provide an EntityFieldQuery tutorial in entity load functions
Setting back to RTBC.
Comment #30
jhodgdonI think I agree with bojanz on this one. We don't provide examples in any of the other Query types. That seems more like something to put in the Handbook?
Comment #31
amateescu commented#26: 920600-26.patch queued for re-testing.
Comment #32
webchickOk, fair enough.
Committed to HEAD. Thanks!