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.
API page: http://api.drupal.org/api/drupal/modules%21user%21user.module/function/u...
Describe the problem you have found:
user_multiple_role_edit() is poorly documented. Patches attached.
Comment | File | Size | Author |
---|---|---|---|
#8 | user_multiple_role_edit.patch | 781 bytes | Liam Morland |
#6 | user_multiple_role_edit.patch | 817 bytes | Liam Morland |
#3 | user_multiple_role_edit.patch | 699 bytes | Liam Morland |
user_multiple_role_edit-d8.patch | 718 bytes | Liam Morland | |
user_multiple_role_edit-d7.patch | 698 bytes | Liam Morland | |
Comments
Comment #1
Liam MorlandComment #2
jhodgdonThanks for bringing this up!
The patches need a bit of work though:
a) Read the help text under the Attachments field -- regarding the file name you need to use so that the test bot will recognize the files as patches to test.
b) If there is no return value, we don't use
See http://drupal.org/node/1354#functions
b) Instead of "uid", in documentation write out "User ID", or in this case perhaps "User IDs".
c) Generally the parameter documentation needs to follow the style of other parameter docs. Such as
Better:
The action to be taken, either "add_role" or "remove_role".
d) You might also check and see whether this function doc is already being cleaned up in this other issue:
#1326666: Clean up API docs for user module
If so, mark this issue as a duplicate of the other one.
Comment #3
Liam MorlandUpdated D8 patch attached. If accepted, I will create D7 version.
Comment #4
jhodgdonMy fault on this one... I should have said "user ID" rather than "User ID".
Maybe you could also fix up the first line of this function according to standards?
http://drupal.org/node/1354#functions
(should start with verb)
Actually though if it is a callback, then it should also have a line about that (see the bottom of that standards section on functions for details).
Comment #5
jhodgdonComment #6
Liam MorlandThanks. Update attached. I am not sure if the callback part is done correctly. The function is used as a callback, but can also be used directly.
Comment #7
jhodgdonGetting closer!
I took a look at user_user_operations and I think maybe for this function we can just omit the callback line, but maybe we should put in
@see user_user_operations()
(that would go at the end of the documentation block)
The first line looks much better. The verb tenses are incorrect though -- should be Adds/removes.
One more thing:
Array of user IDs (int; not string username).
==> How about:
Array of (integer) user IDs.
Thanks for all the iterations!
Comment #8
Liam MorlandUpdated.
Comment #9
jhodgdonOK! Thanks!
Comment #10
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x. Thanks.