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.

Files: 
CommentFileSizeAuthor
#18 user_is_blocked-1552400-18-vesrsion6.patch718 bytesmjonesdinero
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]
#15 user_is_blocked-1552400-15.patch638 bytesmjonesdinero
PASSED: [[SimpleTest]]: [MySQL] 36,974 pass(es).
[ View ]
#13 user_is_blocked-1552400-13.patch641 bytesmjonesdinero
PASSED: [[SimpleTest]]: [MySQL] 37,024 pass(es).
[ View ]
#11 user_is_blocked-1552400-11.patch635 bytesmjonesdinero
PASSED: [[SimpleTest]]: [MySQL] 37,022 pass(es).
[ View ]
#8 user_is_blocked-1552400-7.patch606 bytesSumeetSingh
PASSED: [[SimpleTest]]: [MySQL] 37,007 pass(es).
[ View ]
#7 user_is_blocked-1552400-7.patch606 bytesSumeetSingh
PASSED: [[SimpleTest]]: [MySQL] 37,012 pass(es).
[ View ]
#3 user_is_blocked-1552400-3.patch523 bytesmjonesdinero
PASSED: [[SimpleTest]]: [MySQL] 37,028 pass(es).
[ View ]

Comments

Version:6.x-dev» 8.x-dev
Issue tags:+needs backport to D6, +needs backport to D7

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.

Issue tags:+Novice

Probably a good Novice project

Assigned:Unassigned» mjonesdinero
Status:Active» Needs review
StatusFileSize
new523 bytes
PASSED: [[SimpleTest]]: [MySQL] 37,028 pass(es).
[ View ]

attached is patch that changes the documentation for the API of user_blocked

Status:Needs review» Reviewed & tested by the community

Looks good to go

Status:Reviewed & tested by the community» Needs review

My mistake, wrong issue.

Status:Needs review» Needs work

See comment #1 above - this documentation is not accurate.

Also, it doesn't follow our documentation formatting standards:
http://drupal.org/node/1354#functions

StatusFileSize
new606 bytes
PASSED: [[SimpleTest]]: [MySQL] 37,012 pass(es).
[ View ]

Better description which follows formatting standards.

Status:Needs work» Needs review
StatusFileSize
new606 bytes
PASSED: [[SimpleTest]]: [MySQL] 37,007 pass(es).
[ View ]

For test bot.

Status:Needs review» Needs work

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:

stdClass with the name field of a blocked user, FALSE for active user.

it should probably say:
Object with property 'name' (the user name), if the user is blocked; FALSE if the user is not blocked.

My apologies did not realize, will keep that in mind for future reference.

Status:Needs work» Needs review
StatusFileSize
new635 bytes
PASSED: [[SimpleTest]]: [MySQL] 37,022 pass(es).
[ View ]

updated from what jhodgdon commented

sorry for the wrong format earlier

Status:Needs review» Needs work

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.

Status:Needs work» Needs review
StatusFileSize
new641 bytes
PASSED: [[SimpleTest]]: [MySQL] 37,024 pass(es).
[ View ]

here it is, updated the patch

Status:Needs review» Needs work

Almost there... @param and @return descriptions should end with ".":

+ * @param $name
+ *   A string containing a name of the user

Status:Needs work» Needs review
StatusFileSize
new638 bytes
PASSED: [[SimpleTest]]: [MySQL] 36,974 pass(es).
[ View ]

here it is...

Status:Needs review» Reviewed & tested by the community

Thanks! I'll get this committed shortly.

Version:8.x-dev» 6.x-dev
Status:Reviewed & tested by the community» Patch (to be ported)

I committed the above patch to 8.x and 7.x. Time to backport to 6.x. :)

Status:Patch (to be ported)» Needs review
StatusFileSize
new718 bytes
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

here is the patch for drupal 6

Status:Needs review» Reviewed & tested by the community

That looks correct for Drupal 6.x. Thanks!

Issue tags:-Novice

Removing novice tag since this just needs a commit now.

Assigned:mjonesdinero» Unassigned
Status:Reviewed & tested by the community» Fixed

Thanks again! Finally got this committed to 6.x.

Automatically closed -- issue fixed for 2 weeks with no activity.