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.
Problem/Motivation
Part of meta-issue #1310084: [meta] API documentation cleanup sprint
Proposed resolution
Correct the following in the core field_ui module:
- Ensure that all
@return
lines are preceded by a blank line. - Ensure that
@see
and@ingroup
lines are always at the end of docblocks. - Ensure that all lines in doxygen blocks are 80 characters or fewer (excluding the terminal newline).
- Ensure that all functions, classes, interfaces, and methods have one-line summaries that are clear, use the correct verb tense, and follow specific standards in http://drupal.org/node/1354.
- Make incidental style and grammar corrections only to those docblocks already being updated.
Remaining tasks
Patch needs to be rolled.
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#14 | d7-field-ui.patch | 23.07 KB | xjm |
#14 | interdiff.txt | 14.39 KB | xjm |
#11 | doc-cleanup-field_ui-module-1326638-11.patch | 27.58 KB | jhodgdon |
#9 | doc-cleanup-field_ui-module-1326638-2.patch | 27.57 KB | sven.lauer |
#4 | doc-cleanup-field_ui-module-1326638-1.patch | 27.35 KB | sven.lauer |
Comments
Comment #1
jhodgdonDo you plan to patch this module? If so can you assign the issue to yourself and also add your name to the summary issue? Thanks!
Comment #2
sven.lauer CreditAttribution: sven.lauer commentedSince there hasn't been any word from Lars, I claim this one for now.
Comment #3
Lars Toomre CreditAttribution: Lars Toomre commentedGo ahead sven. As I explained in one of the other threads, I simply created the issue, but did not assign it to myself. (Same with another of the other modules too.)
Comment #4
sven.lauer CreditAttribution: sven.lauer commentedPatch attached.
I opened #1347888: @param / @return docs missing in much of Field UI module, as there are @param/@return missing almost everywhere (I assigned that issue to myself, but won't roll a patch until this patch here is in --- as conflicts are virtually guaranteed).
I had to get creative, as many of the paths of page callbacks and form constructors vary by entity --- and this is not handled via %-placeholders. So I went with the PLACEHOLDER_IN_CAPS convention. Downside: The meaning of the placeholder has to be explained in every function. Alternative ideas welcome.
Comment #5
sven.lauer CreditAttribution: sven.lauer commentedComment #7
xjmTest failed because of #1346772: StatisticsLoggingTestCase->testLogging() fails with clean URLs in some environments. I requeued it.
Comment #8
jhodgdonLooks pretty good! A few things to fix:
a)
field_ui_table should have () after it I think, to make a link to this function (or should be changed to the actual function name if that is not correct)?
Other places need () too, such as:
b)
Hmmm... You had asked about whether this was a good structure... I think it's OK, except I guess I would move the "where BUNDLE..." up onto the same line as Path:. It shouldn't be a new paragraph? In the case of the ones where the paths are a list, I would just remove the blank line between the paths list and the "where..." sentence.
c) Typo (spelling of "row"):
d) Not following standards:
Should include the form function name rather than "on the manage display screen". Probably the following doc block for the Ajax handler should too?
e) Typo (not your fault) field -> fields
f) Should follow the form submission template:
This one too:
g)
Normally we don't need return value docs in menu callbacks... but I could be convinced that it is OK here. Maybe it should say "the field instance array" rather than "the instance array" though?
h) Missing period at the end:
i) Duplicated word "formatter":
Comment #9
sven.lauer CreditAttribution: sven.lauer commentedArg, I should have caught at least some of these things.
Addressed all of the, one way or another. Comments:
(a) 'field_ui_table' is an element #type. I went with the format we agreed on in #1347890: Clean up API docs for file module, and changed the summary to "Render API callback: Performs pre-render tasks on field_ui_table elements." and then included a line in the docblock saying "This function is assigned as a #pre_render callback in field_ui_element_info()."
Made the parallel change for field_ui_field_edit_instance_pre_render() for consistency.
(g) I really think it makes sense to document the return value here, as this is a menu loader function---and these do not have a common return value. Rather, it varies by loader what they return. I did change the return to to "The field instance array." and also added a @ingroup field (though perhaps an @see or a link would be better?). The docgroup page of the field group is where the keys of instance arrays are documented.
Comment #10
sven.lauer CreditAttribution: sven.lauer commentedComment #11
jhodgdonThis is looking really good! I only found this:
a)
(extra space between new and view).
b)
Proves -> Provides
c)
bunde -> bundle
Since these were all simple typos, I just edited the patch file directly and re-uploaded it (after verifying I only made those three changes). Unless the testbot objects, I think we can call this done!
Comment #12
catchLooks good to me. Committed/pushed to 8.x.
Comment #14
xjmAttached removes the menu callback changes, plus a hunk for
field_ui_field_edit_form_delete_submit()
, which does not exist in D7.Comment #15
jhodgdonThese all look like good changes to get into D7. Thanks!
My personal favorite piece of this patch:
ro ro ro your boat!
Comment #17
xjmBot goof.
Comment #18
webchickCommitted and pushed "ro" 7.x! ;) Thanks.
The only thing I found in glancing through was:
That extra indentation shouldn't be there, so I removed it, both in D7 and D8.
Comment #19
jhodgdonHmmm. Are you saying that CSS files should not have @file comments at the top?
It looks like right now some do and some don't. My opinion is that all files should have them... thoughts?
There's nothing specific on
http://drupal.org/node/302199
about @file blocks, but it does basically say to follow the PHP block doc standards when documenting sections of your CSS file...
Comment #20
jhodgdonShould we open a separate issue to discuss that?
Comment #21
sven.lauer CreditAttribution: sven.lauer commentedI think webchick simply meant that
should have been
And not that there should not be any @file header.
Comment #22
webchickYep, that's right.
Comment #23
jhodgdonDuh. I can't read. :)