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.
hook_field_purge_field and hook_field_purge_instance are not documented.
Info on these:
hook_field_purge_field [see function field_purge_field() in modules/field/field.crud.inc]
hook_field_purge_instance [see function field_purge_instance() in modules/field/field.crud.inc]
Part of #675046: Make sure all hooks in D7 have documentation
Comment | File | Size | Author |
---|---|---|---|
#9 | 777092c-01.patch | 1.64 KB | puregin |
#4 | 777092c.patch | 1.61 KB | jhodgdon |
#2 | 777092b.patch | 1.6 KB | jhodgdon |
#1 | 777092.patch | 2.9 KB | jhodgdon |
Comments
Comment #1
jhodgdonHere's a patch.
Comment #2
jhodgdonwhoops, must be getting tired. I forgot to revert that last patch. Sigh. Here's a patch with just the intended changes for this issue.
Comment #4
jhodgdonOK, here's one that should be right... I hope...
Comment #5
aspilicious CreditAttribution: aspilicious commentedDELETED COMMENTS
I was wrong, hooks have to be in the imperative form...
Comment #6
aspilicious CreditAttribution: aspilicious commentedBack to needs review
Comment #7
puregin CreditAttribution: puregin commented@aspilicious: I'm new to this (or rather back after an absense), so I was just looking into the doc standards. Looks like #487802: Function doc standard for Drupal is non-standard in industry has determined that the standard should be changed to "3rd person declarative" for summary lines.
Having a look at the rest of the patch now...
Comment #8
jhodgdonPlease read the doc standards page
http://drupal.org/node/1354
It describes our current standards. That issue is old, and we have different standards for hook *definitions*
Comment #9
puregin CreditAttribution: puregin commentedThe descriptions are good, and the examples make sense. Should we mention what the @return value is?
The attached patch changes the summary lines to 3rd person declarative.
Comment #10
puregin CreditAttribution: puregin commented@jhodgdon thanks for the reference to the new standards. Do you have a pointer to the discussion re: imperative vs. declarative for hooks? Thanks!
Comment #11
jhodgdonNo, not off-hand and no time to search for it. Good luck on that. :)
As you can see on the doxygen standards page, we do not include @return when there is no return value, which there isn' t for these functions.
And, if you read the section on "hook descriptions", you will find that for hooks that my patch in #4 has the correct verb cases
and the one in #9 is incorrect.
http://drupal.org/node/1354#hooks
Comment #12
blg@bgreenaway.com CreditAttribution: blg@bgreenaway.com commentedThis issue is now one of merely the verb case, as all other concerns are in fact fixed (equally) by both patches.
In reference to jhodgdon#4 and puregin#9 a comparison with the list of currently documented (and approved) hook descriptions for D7 here http://api.drupal.org/api/group/hooks/7 clearly shows patch at #4 jhodgdon's is the correct (& more consistent) patch. Verb 'ACT' rather than 'ACTS'.
The linked page shows roughly 10-15% of documented hooks are so far in error in this regard where both execute and executes exist in the docs, declare and declares exist in the doc, alter and alters exist in the doc and many more examples of both plural and singular verb case.
Look for the most common case type, and that is the singular case. As node/1354 points out api.drupal.org standard for hooks is the singular type case. So #4 is both correct, by standards, and passes simpletest testing.
Please commit the patch by jhodgdon, 777092c.patch in comment #4.
Comment #13
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.