I found out that comments header of the $flag->get_user_count() function could be really misguiding. It says that the function returns the number of items. But actually it doesn't return any numbers, it returns executed db_select() object instead.
I suppose it could be appropriate to add fetchField() call to the function so users won't have to go through the code and will got a number in return as they probably expect to.

CommentFileSizeAuthor
#1 get_user_count-1352274-1.patch393 bytesjoelstein
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelstein’s picture

Status: Active » Needs review
FileSize
393 bytes

I completely agree. Attached is a patch which accomplishes this.

joelstein’s picture

Version: 7.x-2.0-beta6 » 7.x-2.x-dev

Will somebody please review this simple patch? It corrects expected functionality. Thanks!

walker2238’s picture

I gave it a quick test and don't see any issues.

joelstein’s picture

Thanks! Want to mark it as "reviewed & tested by the community"?

walker2238’s picture

Status: Needs review » Reviewed & tested by the community

Opps, sorry.

socketwench’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Looks good.

Committed to dev: http://drupalcode.org/project/flag.git/commit/4f321b8

Marking closed (fixed).