undefined function boost_views_pre_view

jasbeau - October 31, 2009 - 19:28
Project:Boost
Version:6.x-1.13
Component:Installation
Category:support request
Priority:normal
Assigned:Unassigned
Status:fixed
Description

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

#1

mikeytown2 - October 31, 2009 - 20:43

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'?

<?php
/**
* 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);
    }
  }
}
?>

<?php
 
/**
   * 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();
  }
?>

#2

mikeytown2 - November 3, 2009 - 00:43
Status:active» postponed (maintainer needs more info)

#3

jasbeau - November 3, 2009 - 21:00

Looks like eaccelerator. php.ini attached

AttachmentSize
php.ini_.txt 39.7 KB

#4

mikeytown2 - November 3, 2009 - 21:31

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.

#5

jasbeau - November 3, 2009 - 22:08

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

enable boost

restart apache

errors same as before

Jasbeau

#6

mikeytown2 - November 3, 2009 - 23:03
Status:postponed (maintainer needs more info)» needs review

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.

AttachmentSize
boost-619852.patch 738 bytes

#7

jasbeau - November 3, 2009 - 23:39

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

#8

mikeytown2 - November 3, 2009 - 23:41

So this should work then

AttachmentSize
boost-619852.1.patch 739 bytes

#9

mikeytown2 - December 5, 2009 - 08:35
Status:needs review» postponed (maintainer needs more info)

is this still an issue for anyone?

#10

preper - December 5, 2009 - 18:33

I have the same problem.

#11

mikeytown2 - December 5, 2009 - 18:52
Status:postponed (maintainer needs more info)» fixed

screw it; hack has been committed.

#12

mikeytown2 - December 5, 2009 - 18:56

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

#13

preper - December 7, 2009 - 21:50

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...

#14

mikeytown2 - December 8, 2009 - 04:42

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

#15

preper - December 8, 2009 - 09:43

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.

#16

preper - December 8, 2009 - 10:22

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

 
 

Drupal is a registered trademark of Dries Buytaert.