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.

CommentFileSizeAuthor
#2 2789795-count-alter.patch753 bytespebosi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pebosi created an issue. See original summary.

pebosi’s picture

FileSize
753 bytes
pebosi’s picture

Status: Active » Needs review
SocialNicheGuru’s picture

Status: Needs review » Needs work

patch -p1 < 2789795-count-alter.patch
patching file registration.module
patch: **** malformed patch at line 24:

john.oltman’s picture

Status: Needs work » Closed (outdated)