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.
Comment | File | Size | Author |
---|---|---|---|
#18 | user_is_blocked-1552400-18-vesrsion6.patch | 718 bytes | mjonesdinero |
#15 | user_is_blocked-1552400-15.patch | 638 bytes | mjonesdinero |
#13 | user_is_blocked-1552400-13.patch | 641 bytes | mjonesdinero |
#11 | user_is_blocked-1552400-11.patch | 635 bytes | mjonesdinero |
#8 | user_is_blocked-1552400-7.patch | 606 bytes | SumeetSingh |
Comments
Comment #1
jhodgdonThanks 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.
Comment #2
jhodgdonProbably a good Novice project
Comment #3
mjonesdinero CreditAttribution: mjonesdinero commentedattached is patch that changes the documentation for the API of user_blocked
Comment #4
SumeetSingh CreditAttribution: SumeetSingh commentedLooks good to go
Comment #5
SumeetSingh CreditAttribution: SumeetSingh commentedMy mistake, wrong issue.
Comment #6
jhodgdonSee comment #1 above - this documentation is not accurate.
Also, it doesn't follow our documentation formatting standards:
http://drupal.org/node/1354#functions
Comment #7
SumeetSingh CreditAttribution: SumeetSingh commentedBetter description which follows formatting standards.
Comment #8
SumeetSingh CreditAttribution: SumeetSingh commentedFor test bot.
Comment #9
jhodgdonSumeetSingh: 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.
Comment #10
SumeetSingh CreditAttribution: SumeetSingh commentedMy apologies did not realize, will keep that in mind for future reference.
Comment #11
mjonesdinero CreditAttribution: mjonesdinero commentedupdated from what jhodgdon commented
sorry for the wrong format earlier
Comment #12
jhodgdonThanks! 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.
Comment #13
mjonesdinero CreditAttribution: mjonesdinero commentedhere it is, updated the patch
Comment #14
jhodgdonAlmost there... @param and @return descriptions should end with ".":
Comment #15
mjonesdinero CreditAttribution: mjonesdinero commentedhere it is...
Comment #16
jhodgdonThanks! I'll get this committed shortly.
Comment #17
jhodgdonI committed the above patch to 8.x and 7.x. Time to backport to 6.x. :)
Comment #18
mjonesdinero CreditAttribution: mjonesdinero commentedhere is the patch for drupal 6
Comment #19
jhodgdonThat looks correct for Drupal 6.x. Thanks!
Comment #20
star-szrRemoving novice tag since this just needs a commit now.
Comment #21
jhodgdonThanks again! Finally got this committed to 6.x.