After installing and enabling Boost loading view content produces Fatal error: Call to undefined function boost_views_pre_view() in /home/rxymfash/public_html/drupal/modules/views/includes/view.inc on line 769

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

This is a really weird error. Boost is using the hook_views_pre_view() views hook which uses module_implements() to figure out if the function should be called. What kind of Op Code cache are you using'?

/**
 * Implementation of hook_views_pre_render().
 *
 * This is called right before the render process. Used to grab the NID's listed
 * in this view, and set the view node relationship in the database.
 *
 * @param &$view
 *  reference to the view being worked on
 */
function boost_views_pre_render(&$view) {
  if (!is_null($view) && $GLOBALS['_boost_cache_this'] && !BOOST_NO_DATABASE) {
    foreach ($view->result as $item) {
      $node = node_load($item->nid);
      $GLOBALS['_boost_relationships'][] = array('child_page_callback' => 'node', 'child_page_type' => $node->type, 'child_page_id' => $item->nid);
    }
  }
}
  /**
   * Run attachments and let the display do what it needs to do prior
   * to running.
   */
  function pre_execute($args = array()) {
    $this->old_view[] = views_get_current_view();
    views_set_current_view($this);
    $display_id = $this->current_display;

    // Let modules modify the view just prior to executing it.
    foreach (module_implements('views_pre_view') as $module) {
      $function = $module . '_views_pre_view';
      $function($this, $display_id, $args);
    }

    // Prepare the view with the information we have, but only if we were
    // passed arguments, as they may have been set previously.
    if ($args) {
      $this->set_arguments($args);
    }

//    $this->attach_displays();

    // Allow the display handler to set up for execution
    $this->display_handler->pre_execute();
  }
mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)
jasbeau’s picture

FileSize
39.7 KB

Looks like eaccelerator. php.ini attached

mikeytown2’s picture

memory_limit = 32M      ; Maximum amount of memory a script may consume (32MB)
eaccelerator.enable="1"

Try 2 things:
* Up the memory
* Disable eaccelerator

Let me know the results.

jasbeau’s picture

set:
memory_limit: 64M
eaccelerator.enable="0"

enable boost

restart apache

errors same as before

Jasbeau

mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
738 bytes

In comment #1 I should have said that boost uses hook_views_pre_render(). It never uses hook_views_pre_view() and for some reason module_implements() thinks boost has defined that function. Drupal uses the module_hook() function to see if a module has declared a hook.

You can try this patch hack, It declares an empty boost_views_pre_view() function. But something is wrong, PHP is thinking that function exists when it doesn't.

If I get more reports of this happening then I will add in the hack, but for now I would like to keep this out of the boost module.

jasbeau’s picture

patch produces warnings:

* warning: Missing argument 2 for boost_views_pre_view(), called in /home/rxymfash/public_html/drupal/modules/views/includes/view.inc on line 769 and defined in /home/rxymfash/public_html/drupal/sites/all/modules/boost/boost.module on line 159.
* warning: Missing argument 3 for boost_views_pre_view(), called in /home/rxymfash/public_html/drupal/modules/views/includes/view.inc on line 769 and defined in /home/rxymfash/public_html/drupal/sites/all/modules/boost/boost.module on line 159.

remove &$view, &$display_id, from function definition and warnings go away

Jasbeau

mikeytown2’s picture

FileSize
739 bytes

So this should work then

mikeytown2’s picture

Status: Needs review » Postponed (maintainer needs more info)

is this still an issue for anyone?

preper’s picture

I have the same problem.

mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Fixed

screw it; hack has been committed.

mikeytown2’s picture

just wondering, what 3rd party views modules are you using?

preper’s picture

Views 6.x-2.1
Views exporter 6.x-2.1
Views UI

I use just those... I disable views modules and tried again but I have taken the same problem again...

mikeytown2’s picture

It's not a views module, its a 3rd party module that uses views that is causing the error.

preper’s picture

I closed the panels and views module then tried again boost module works great. but when I enable the views module (not panels) it gives the same errror again. I think there is a problem with views module.

preper’s picture

I remove panels module from the system and enable views module boost does not work again. The problem is about views module...

Status: Fixed » Closed (fixed)

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

preper’s picture

is there any solution?

mikeytown2’s picture

@preper
get the latest dev