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
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
#3
Looks like eaccelerator. php.ini attached
#4
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
set:
memory_limit: 64M
eaccelerator.enable="0"
enable boost
restart apache
errors same as before
Jasbeau
#6
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
patchhack, 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.
#7
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
So this should work then
#9
is this still an issue for anyone?
#10
I have the same problem.
#11
screw it; hack has been committed.
#12
just wondering, what 3rd party views modules are you using?
#13
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
It's not a views module, its a 3rd party module that uses views that is causing the error.
#15
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
I remove panels module from the system and enable views module boost does not work again. The problem is about views module...