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.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | get_user_count-1352274-1.patch | 393 bytes | joelstein |
Comments
Comment #1
joelstein CreditAttribution: joelstein commentedI completely agree. Attached is a patch which accomplishes this.
Comment #2
joelstein CreditAttribution: joelstein commentedWill somebody please review this simple patch? It corrects expected functionality. Thanks!
Comment #3
walker2238 CreditAttribution: walker2238 commentedI gave it a quick test and don't see any issues.
Comment #4
joelstein CreditAttribution: joelstein commentedThanks! Want to mark it as "reviewed & tested by the community"?
Comment #5
walker2238 CreditAttribution: walker2238 commentedOpps, sorry.
Comment #6
socketwench CreditAttribution: socketwench commentedLooks good.
Committed to dev: http://drupalcode.org/project/flag.git/commit/4f321b8
Marking closed (fixed).