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.
When using hook_registration_event_count_alter the value is altered the cached value twice. Every time you call registration_event_count for a specific entity_id will be altered, but it should only once.
I use the hook to increment the count by 1, so one a second call the count is incremented by 2. To fix this move the drupal_alter call into the if condition.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2789795-count-alter.patch | 753 bytes | pebosi |
Comments
Comment #2
pebosi CreditAttribution: pebosi as a volunteer commentedComment #3
pebosi CreditAttribution: pebosi as a volunteer commentedComment #4
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedpatch -p1 < 2789795-count-alter.patch
patching file registration.module
patch: **** malformed patch at line 24:
Comment #5
john.oltman CreditAttribution: john.oltman at SiteBasin, Inc. commented