registration_event_count's static caching is borked. It will only remember the value for the first entity queried:

function registration_event_count($entity_id, $entity_type) {
  $count = &drupal_static(__FUNCTION__, FALSE);
  if (!$count) {
    $count = db_query("SELECT sum(count) FROM {registration} WHERE entity_id = :entity_id AND entity_type = :entity_type",
      array(':entity_id' => $entity_id, ':entity_type' => $entity_type)
    )->fetchField();    
  }
  return $count;
}

Comments

levelos’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

engrish

  • levelos committed 2cfe244 on 7.x-1.x, panels, any-entity, slots, integrations, hold_state
    #1498432: Set proper static variable in registration_event_count().