Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2011 at 17:29 UTC
Updated:
4 Jan 2014 at 01:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rc_100 commentedUpdating documentation for the help module.
Comment #2
jhodgdonThanks! By the way, normally I would suggest leaving an issue assigned to you until it has been committed, unless you don't want to continue working on it if there are things that need to be fixed.
Reviewing the patch...
a)
Verb at beginning is not the right tense. See http://drupal.org/node/1354#functions -- and I think this function probably has a return value, so it needs @return docs?
b)
That first line - you added a space to the line, which isn't good. There should not be spaces at the ends of any lines. Try to configure your editor to either remove spaces at ends of lines automatically, or at least show you where there are spaces at ends of lines.
And note that this occurs elsewhere in the file as well.
c)
- Function and method docs need to start with one 80-character-max sentence line.
- Wrong verb tense. Should probably be" "Logs in users, creates..., and tests..."
- This problem is repeated lower down in the same file on other functions.
d)
This is an override of a base class method. Standards for documenting it:
http://drupal.org/node/1354#classes
Should just say "Overrides ..." . Same with the setUp() method below there.
Comment #3
rc_100 commentedok, will fix - thanks for the feedback. there's something in the meta-issue summary about unassigning yourself from the issue when you submit a patch, but perhaps I misunderstood that part. fixed patch coming soon!
Comment #4
rc_100 commentedFixed patch, incorporating recommendations.
I checked the parent classes that HelpTestCase was extending (DrupalWebTestCase and DrupalTestCase), but I couldn't find what class function getInfo() was overriding, so I left the comment as is for that function.
Comment #5
jhodgdonI fixed the meta-issue. Someone else put that text in there saying to unassign the issue. I took it back out.
You're right about the getInfo(). That doesn't appear to be defined on any of the test case base classes. I guess it's sort of an implicit interface that everyone knows about but isn't stated anywhere. Interesting.
Anyway, back to the patch... Looks much better! A few things to fix:
a)
See http://drupal.org/node/1354#inline -- we actually don't require verb tenses like this in in-line comments (and they're not at all common -- usually the in-line comments describe what is happening and/or why, so they use verb tenses like the original here). If you do want to fix that comment, you could add a "." at the end.
b)
I like this comment, except that we try not to abbreviate words like "information" in documentation. Note: this appears twice in the file.
c)
create -> creates
Note: this appears twice in the file.
d) You could fix up the @param formatting here:
The @return in the next function is also not formatted correctly.
e)
Should be "Gets the list..."
Comment #6
rc_100 commentedok, rerolled patch - thanks again for the feedback (and patience as I learn the process).
Comment #7
jhodgdonBetter! Only a couple of things to fix:
a)
This still needs to end in .
b)
The data type array should be on the same line as @return. And maybe it would be clearer to say "A list of the enabled modules." rather than just "Enabled modules"?
c)
- Your editor seems to have added a space to the end of that first line after "protected $big_user".
- The $big_user member variable needs a documentation block.
d) I took a look at the existing files in the modules/help directory. help.admin.inc is not following the (new!) standards at http://drupal.org/node/1354#menu-callback and needs an update. Also the first class in help.test doesn't have a docblock for the class, and the second one needs a verb update.
e) The docs for hook_help() in help.api.php -- actually, hook *definitions* are an exception to the verb rule:
http://drupal.org/node/1354#hooks -- so it actually should be saying "Provide online user help" as it does before your patch.
Comment #8
rc_100 commentedok, here's the latest!
wasn't sure how to specify an arbitrary path for help_page(), so I used:
admin/help/*
Comment #9
jhodgdonThis is getting *very* close! Just three little items to fix and we're good to go!
a) That seems like a good idea for the help_page() path... however we normally use % for wildcards in hook_menu() router paths, so I think that would be a better idea. I've put that in the specs, and we should update this patch.
b) Just a small clarification on the menu callback standard from http://drupal.org/node/1354#menu-callback
- After the :, the next word should be capitalized.
- Rather than calling it a "menu callback", we want to be specific about the type of callback in hook_menu() -- page, title, access, or whatever. In this case, it's "Page callback:".
c)
Each member variable should have a separate doc header. The reason is that each one will appear separately on api.drupal.org, so each one needs its own description.
Comment #10
rc_100 commentedok, hope you're not getting tired of this!
Comment #11
jhodgdonNot at all -- I hope you aren't either!
I think this is ready! Thanks for all the iterations.
Comment #12
catchUnless I missed a change somewhere we never add phpdic for getInfo() since it's just extending the base class which already has documentation.
Comment #13
jhodgdonSee comment #4/5 above. Actually, getInfo() is not documented anywhere that we could find -- it is not on the base class apparently.
Comment #14
catchSee #338403: Use {@inheritdoc} on all class methods (including tests) and http://drupal.org/node/325974. If you want to revert that decision then that needs a new issue with its own discussion.
Comment #15
jhodgdonOK, I'm reopening that issue, which I had never seen before.
Comment #16
xjmNote that (in addition to the change suggested above) this patch will need to be rerolled, because the core directory structure for Drupal 8 has now changed. (For more information, see #22336: Move all core Drupal files under a /core folder to improve usability and upgrades). If you need help rerolling this patch, you can come to core office hours or ask in #drupal-gitsupport on IRC.
Comment #17
rc_100 commentedI've rerolled to comply with the new 8.x directory structure. I haven't done anything about #14, because it sounds like those changes haven't been finalized yet (if not let me know). Thanks!
Comment #18
xjmThanks @rc_100! A couple small things I noticed:
It would be better not to include this change, since it's outside of the docblock and makes this patch more likely to collide with others.
Trailing whitespace here.
And yeah I'm not sure which way to go on the test methods.
Comment #19
jhodgdonFor the test methods, go ahead and leave those docblocks off. If we change this on that other issue, that issue will include a patch to put in the docblocks for all the core tests.
Comment #20
jhodgdonSetting to needs work as per #19. So if you can take care of that, and remove the getInfo() and setUp() docblocks from the tests, we can probably get this back to RTBC and get it committed. Thanks!
Comment #21
rc_100 commentedI've fixed issues in #18 and completely removed docblocks from getInfo() and setUp() in the .test file. Let me know if you see anything else. Thanks!
Comment #22
jhodgdonEverything in this patch looks good to me now. Let's get it in. Thanks!
Comment #23
catchCommitted/pushed to 8.x, thanks!
Comment #25
xjmCouple menu callback things removed.
Comment #26
jhodgdonThis looks fine for d7. Thanks!
Comment #27
webchickCommitted and pushed to 7.x. Thanks!