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.
The count on the invites page and upper right notification icon is incorrect.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2038251-commons-notify-counts-8.patch | 7.8 KB | ezra-g |
#9 | 2038251-commons-trusted-contacts-counts-8.patch | 4.11 KB | ezra-g |
Screenshot_7_9_13_3_17_PM.png | 226.77 KB | japerry |
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedComment #2
jpontani CreditAttribution: jpontani commentedI can't reproduce it directly, but can see how it could happen in theory. The value displayed in both the tab count and the upper right corner icon are the values stored in the field_unread_messages/field_unread_invitations fields. If those get out of sync with the actual values, or somehow cached, then it will show incorrect values. I did a test by changing the tab/icon counts to do the same method that is used for getting the trusted contacts count, which is to grab the view, execute it, and show the total results.
IE, this part:
Comment #3
ezra-g CreditAttribution: ezra-g commentedThanks, jpontani! I asked amitaibu to comment on the proposed approach here. I suspect the concern was around render time for the views. Some profiling might help inform us here.
Comment #4
amitaibuKeeping a field Vs on the fly is mostly a matter of taste, and since it's a value that appears on every single page I preferred keeping it in a field. However on the fly calculation of messages would probably not be Commons' performance bottle neck ;)
Anyway, Views IMO shouldn't be use - it's an overkill just to get a number. db_query() would be much nicer.
Comment #5
ezra-g CreditAttribution: ezra-g commentedCan we get steps to reproduce this?
Comment #6
ezra-g CreditAttribution: ezra-g commentedComment #7
ezra-g CreditAttribution: ezra-g commentedComment #9
ezra-g CreditAttribution: ezra-g commentedThis patch defines a new helper function: commons_trusted_contacts_get_pending_invitations(), and uses the existing privatemsg_unread_count(), and replaces and removes the unread count fields.
Comment #10
ezra-g CreditAttribution: ezra-g commentedComment #11
svajlenka CreditAttribution: svajlenka commentedI was experiencing this issue and the patch in #9 worked for me.
Comment #12
ezra-g CreditAttribution: ezra-g commented#9 is committed.
http://drupalcode.org/project/commons_trusted_contacts.git/commit/e11d950
http://drupalcode.org/project/commons_notify.git/commit/0586dab