A friend/developer was troubleshooting the excessive number of queries on a website recently, noticing that some module was causing the menu to rebuild on every page load. He discovered that it seemed to be from the biblio module. To fix it, he commented out these lines, at approximately 510 of biblio.module:

  if ($type == 'after_update' && $category == 'account') {
    menu_rebuild();
  }

Comments

rjerome’s picture

I'd say there's something else wrong with your site, cause you shouldn't hit that code on every page load.

Ron

mariagwyn’s picture

Actually, it happens every time a user saves (which happens frequently as users are checked against a civicrm database to be sure the membership is upgraded). Biblio also rebuilds the menu every time. When this is commented out, the save is fine.

rjerome’s picture

Commenting it out should have little or no impact. That was there so that if the user changed some of their biblio settings with affected the menu display, they would be updated immediately.

I'll look for a way to detect that one of my settings is changed before invoking menu_rebuild.

I'm still a bit surprised that user data is saved that frequently, but every site is different...

Ron.

mariagwyn’s picture

I am not happy that user data is save as frequently as it is. It appears that a member status in Civicrm is checked, and then it saves the drupal user and his/her corresponding role. This is the only way to keep member data in Civi matching member access in drupal. Frankly, it sucks and is an ugly process. I can't get around it. As a complete side effect, the saving due to Civi was also saving biblio user data and rebuilding the menu. My query load was going crazy.

It really isn't biblio's issue, it was just that civi seems to have exposed a possible weakness in biblio.

Commenting it out has had no real affect, so things are stable so far. If you update or find another way, let me know since I would rather not use a hacked biblio, a module I like and plan to use extensively!

maria

liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.