Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have an interesting trouble on couple of our sites. The hook_page_build implementations sometimes looses some value from cache.


Using this cose, I get the following result: block, panels_everywhere, rules, admin_menu.

  $implementations_cache = cache_get('module_implements', 'cache_bootstrap');
  $cache = $implementations_cache->data['page_build'];

Using the following code, I get the following result: block, metatag, panels_everywhere, toggle_page_elements, rules, admin_menu, admin_menu_toolbar.

  $hook_info = module_hook_info();
  $hook = 'page_build';  
  $implementations[$hook] = array();
  $list = module_list(FALSE, FALSE, FALSE);
  foreach ($list as $module) {
    $include_file = isset($hook_info[$hook]['group']) && module_load_include('inc', $module, $module . '.' . $hook_info[$hook]['group']);
    if (function_exists($module . '_' . $hook)) {
      $implementations[$hook][$module] = $include_file ? $hook_info[$hook]['group'] : FALSE;

We are using the latest dev of the Memcache module as cache backend.

As I see, only hook_page_build() is affected. I can't catch any event, which causes that, and I don't see any relevant in the log. Clear class registry fix it, but became wrong 1-2 times in a day.

Why does this happen?

Adding debug code to cache_set(), I experienced the following.

This starts when a user load two pages close to same time:

  • user/%user/points 1358402424.7797
  • user/%user/subscriptions 1358402424.0462

Other hooks are affected: init, ctools_plugin_api, entity_view, flag_default_flag, element_info_alter, ctools_render_alter, page_build, form_alter. The following modules seem affected: rate, a custom feature, metatag, metatag_opengraph, better_formats, admin_menu_toolbar, toggle_page_elements (this is a custom module).

I didn't see anythimg relevant in the system table.

If this makes a difference, the site uses a master-slave database environment with with the Autoslave module.

share|improve this question
This might be caused by #496170 if something is invoking hook_page_build before the DRUPAL_BOOTSTRAP_FULL bootstrap phase is reached. – znerol Jul 19 '15 at 10:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.