Posted by keithleeds on April 28, 2012 at 10:57pm
6 followers
| Project: | Drupal core |
| Version: | 6.x-dev |
| Component: | documentation |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | needs backport to D6, needs backport to D7 |
Issue Summary
API page: http://api.drupal.org/api/drupal/modules%21user%21user.module/function/u...
> Checks for usernames blocked by user administration.
> Return value
>
> boolean TRUE for blocked users, FALSE for active.
Should be:
boolean TRUE for blocked users, FALSE for active or name not found.
Comments
#1
Thanks for reporting this! Actually, it doesn't look like user_is_blocked() returns a Boolean value at all, in most cases. It returns a stdClass object if the query succeeds, and FALSE (at least in MySQL) if the query fails. This is incorrectly documented in Drupal 7 and 8 also.
By the way, please read the tagging guidelines (below the Tags field when reporting/commenting on an issue), and please don't make up your own tags.
#2
Probably a good Novice project
#3
attached is patch that changes the documentation for the API of user_blocked
#4
Looks good to go
#5
My mistake, wrong issue.
#6
See comment #1 above - this documentation is not accurate.
Also, it doesn't follow our documentation formatting standards:
http://drupal.org/node/1354#functions
#7
Better description which follows formatting standards.
#8
For test bot.
#9
SumeetSingh: Thanks for the patch... A few thoughts:
a) mjonesdinero had assigned the issue to himself, and it had only been a few hours since I reviewed his patch. It would be a bit more polite in the future to ask first "Are you still working on this?" and wait for a few days, before taking over an issue that someone is already working on. Thanks!
b) The formatting in this patch is not correct. Indentation is 2 spaces extra in @param/@return. It looks like you used tabs.
c) In documentation text, we don't normally say "stdClass", and we like to use complete sentences. So instead of this for the @return:
it should probably say:
Object with property 'name' (the user name), if the user is blocked; FALSE if the user is not blocked.
#10
My apologies did not realize, will keep that in mind for future reference.
#11
updated from what jhodgdon commented
sorry for the wrong format earlier
#12
Thanks! One more fix though: Documentation needs to be wrapped into 80-character lines. See
http://drupal.org/node/1354#general
So that @return documentation needs wrapping.
#13
here it is, updated the patch
#14
Almost there... @param and @return descriptions should end with ".":
+ * @param $name+ * A string containing a name of the user
#15
here it is...
#16
Thanks! I'll get this committed shortly.
#17
I committed the above patch to 8.x and 7.x. Time to backport to 6.x. :)
#18
here is the patch for drupal 6
#19
That looks correct for Drupal 6.x. Thanks!
#20
Removing novice tag since this just needs a commit now.
#21
Thanks again! Finally got this committed to 6.x.
#22
Automatically closed -- issue fixed for 2 weeks with no activity.