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.
Part of meta-issue #1310084: [meta] API documentation cleanup sprint.
Comment | File | Size | Author |
---|---|---|---|
#26 | d7-contact.patch | 11.71 KB | xjm |
#26 | interdiff.txt | 4.97 KB | xjm |
#22 | doc-cleanup-contact-module-1332636-10.patch | 12.3 KB | sven.lauer |
#20 | doc-cleanup-contact-module-1332636-9.patch | 12.3 KB | sven.lauer |
#17 | doc-cleanup-contact-module-1332636-8.patch | 12.3 KB | sven.lauer |
Comments
Comment #1
sven.lauer CreditAttribution: sven.lauer commentedComment #2
jhodgdonThanks -- mostly looks OK - a couple of things to fix:
a)
List -> Lists
b)
submit -> submission -- see http://drupal.org/node/1354#forms
c)
Page - word is repeated.
d)
site-wide --> the site-wide
Other places that could use "the":
ids -> IDs. "id" is a psychological term. "ID" is short for identifier/identification.
f)
submit -> submits
Comment #3
sven.lauer CreditAttribution: sven.lauer commentedRe-rolling. All mentioned issues are addressed in this patch.
Comment #4
jhodgdonThis still could use a few more "the"s:
+ * Form constructor for category edit form.
+ * Form constructor for contact category deletion form.
+ * Tests site-wide contact form.
+ * Tests configuration options and site-wide contact form.
And maybe a few less too:
+ * Enables the use of personal and the site-wide contact forms.
... This one should either have two "the" or no "the". I think no "the" is probably better, since forms is plural.
One other thing I didn't notice last review:
+ * Page callbacks for the contact module.
Refer to modules either as "the Contact module" or "contact.module" (no the)
And this @return needs a newline in the middle:
Should probably be:
Other than that, looking pretty close...
Comment #5
sven.lauer CreditAttribution: sven.lauer commentedFixing the issues mentioned in #4.
Comment #6
sven.lauer CreditAttribution: sven.lauer commentedI realized I missed one of the points in #4 on the last re-roll.
Comment #7
xjmI reviewed #4 and checked the module with the patch applied, and I found a few things. Many have to do with the new menu callback standard.
I think we want an @see to the
hook_menu()
implementation that registers this path and callback, correct?Minor point but I'd de-capitalize "Category" here. It's not a title in this instance, just a noun. So: "A list of the category IDs." Edit: Looks like @jhodgdon mentioned that same point as well.
_contact_personal_tab_access()
probably needs to be adjusted to the menu callback standard: http://drupal.org/node/1354#menu-callback. There might be others as well.contact_form_user_admin_settings_alter()
.contact.test
has some @param that are malformatted. Not sure if we should clean that up here or not.drupal_get_form()
, which in turn is the page callback. What do you think?Thanks!
Comment #8
sven.lauer CreditAttribution: sven.lauer commented1-2.: Fixed
3: I changed to "Access callback: ..." format, and remove the @return---this is really redundant here, as it is the same for all access callbacks. Also clarified the $account param documentation and added the path.
4: Added those, because it makes sense to me, even though this is not a standard ... though maybe it should be?
5: I've generally fixed up .test files (but must have overlooked the params here), so I did those, too.
6: I have not done this (yet), because I don't agree that the solution in #1313980: Clean up API docs for node module is a good idea. I do agree, though, that form constructors that basically function as page callbacks should get a similar treatment. I actually opened #1337282: Lacking doc header standard for forms used as page callbacks just because of this. Which basically agrees with the hybrid approach, except that it leaves the introductory line alone.
Two arguments for that:
So I say: Let us add "Path: ..." lines and @see directives pointing to the hook_menu implementation, but not use the "Page callback: " prefix.
Comment #9
sven.lauer CreditAttribution: sven.lauer commentedAaaand actually attaching the patch. Duh.
Comment #10
xjmI replied to #1337282: Lacking doc header standard for forms used as page callbacks. I think you're right about that.
Should we add the menu paths and
@see
tocontact_menu()
for these, then?Comment #11
jhodgdonI suppose we'd better postpone this until we arrive at a standard...
Comment #12
sven.lauer CreditAttribution: sven.lauer commentedNow that #1337282: Lacking doc header standard for forms used as page callbacks is settled, I added the paths and @see directives to all form constructors.
Comment #13
xjmThanks @sven.lauer. I noticed a few more things when I read through it this time. (I just read the patch; I didn't apply it.)
I think this has extra indentation? The hyphens should line up with the previous line. Reference: http://drupal.org/node/1354#lists
Maybe we should define allowed keys here? First few lines of the function show what they are. They get used as default values for the form elements. Also, the second should probably have an article.
I checked contact_category_edit_form_submit() to see if there was an API function we should reference, but it just runs DB queries directly rather than using any API functions. Maybe we should open a followup issue to decouple the submit handler from the save functionality.
This should be "Tests for the Contact module," correct?
We could probably fix these up a little while we're reformatting them. E.g., "The category name," "The category ID," etc., and maybe add a bit more information about how each parameter is used. "Defaultly selected" is especially creative; perhaps "A boolean indicating whether the category should be selected by default," or something. (I didn't check the method to see what it actually does.)
Maybe "Tests access to the personal contact form" for less ambiguity? Debatable, I guess.
Comment #14
sven.lauer CreditAttribution: sven.lauer commentedRe-rolling with the suggested fixes---I had seen these less-than-helpful param docs, but thought that maybe this is something that should not be fixed in the cleanup patch. But now I tried to improve them.
Comment #15
xjmYeah, I guess it's kinda borderline to fix them, but since the patch is a manageable size and we're changing the lines anyway it seems worthwhile to me. The new text is far more useful.
Couple typos:
Looks like an extra blank line here? Edit: Whoops, meant to select more context than that. I'll add another comment with the whole hunk.
Typo here, unless The-mail is a new mail service to replace all others. :)
Comment #16
xjmThe extra blank line.
9 days to next Drupal core point release.
Comment #17
sven.lauer CreditAttribution: sven.lauer commentedFixing the two issues in #15/#16.
Comment #18
xjmContact module is lowercased here. Sorry, not sure how I missed that in #15.
Comment #19
jhodgdonstatus update per previous comment
Comment #20
sven.lauer CreditAttribution: sven.lauer commentedNo problem. Fixed patch attached.
Comment #21
xjmI found two more small things:
Typo here ("thw").
I don't think "E-mail" should be capitalized here. (Elsewhere it's lowercased.)
Comment #22
sven.lauer CreditAttribution: sven.lauer commentedFixing these issues.
Comment #23
xjmAlright, everything looks great to me now.
Comment #24
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks for the continuous efforts on making our documentation better.
Comment #26
xjmWith new menu standard stuff removed for the backport.
Comment #27
jhodgdonThis all looks good for d7, thanks!
Comment #28
webchickCommitted and pushed to 7.x. Thanks!
Comment #30
Lars Toomre CreditAttribution: Lars Toomre commentedFor reference, I created #1811628: Further clean up of API docs for Contact module to resolve some further documentation issues.