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.
Global flags set the uid to 0 in the {flagging} table.
Meanwhile flag_get_user_flag_counts() adds a condition on the uid field.
That means what flag_get_user_flag_counts() will always return 0 for a given flag and user if the flag is global.
Given that the purpose of flag_get_user_flag_counts() is to return the number of flaggings the user has made with a given flag, this makes sense.
However, this should be documented in the function -- that it doesn't serve global flags at all.
Comment | File | Size | Author |
---|---|---|---|
#2 | flag-fix_documentation_for_flag_get_user_flag_counts-2208759-2.patch | 460 bytes | cs_shadow |
Comments
Comment #1
joachim CreditAttribution: joachim commentedComment #2
cs_shadow CreditAttribution: cs_shadow commentedAdded a line in documentation that this method does not serves global flags. Any suggestions are welcome.
Comment #3
joachim CreditAttribution: joachim commentedComment #4
joachim CreditAttribution: joachim commentedComment #5
joachim CreditAttribution: joachim commentedCommitted! Sorry for the long delay. Thanks for the patch!