$result = db_query("SELECT * FROM {variable} WHERE name like 'event_nodeapi_%'");
    while ($type = db_fetch_object($result)) {
      $types[unserialize($type->value)][] = substr($type->name, 14);
    }

in this part of the function event_get_types a query is done on the variable table. This is completely unneeded because variables are loaded every page load. I understand why you query though, you don't wanna run through all the array keys to check for event_ x. However it would be much nicer if you would just save all the stuff in one variable as an array.

By doing that is saves you a query because you already have the data and you don't need to unserialize and substr....

Unfortunatly I don't have time to make a patch right now so I hope you do. If not I might check in later to do so.

Comments

gerhard killesreiter’s picture

I agree, but I have no time to patch this since there's an upgrade path involved...

japerry’s picture

Status: Active » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.