To reproduce:
1. Add a new view of type node.
2. Add a new page display and set the path to be "view_error"
3. Add an attachment display. Set it to attach to the "Page" display created in step 2.
4. Add a field to the default display, for example Node: Title.
5. In the preview box, select page and click the preview button.
You should get a message that says:
http://localhost
An error occurred.
I'm running Apache 2 and PHP 5.2.5, provided by the MAMP package (v. 1.7.1).
If I look in my php_error.log file, I get the following after trying to preview the view:
[03-May-2008 14:23:23] PHP Fatal error: Call to a member function pre_execute() on a non-object in /Applications/MAMP/htdocs/port/drupal/sites/all/modules/views/includes/view.inc on line 698
[03-May-2008 14:23:23] PHP Stack trace:
[03-May-2008 14:23:23] PHP 1. {main}() /Applications/MAMP/htdocs/port/drupal/index.php:0
[03-May-2008 14:23:23] PHP 2. menu_execute_active_handler() /Applications/MAMP/htdocs/port/drupal/index.php:18
[03-May-2008 14:23:23] PHP 3. call_user_func_array() /Applications/MAMP/htdocs/port/drupal/includes/menu.inc:346
[03-May-2008 14:23:23] PHP 4. views_ui_preview() /Applications/MAMP/htdocs/port/drupal/includes/menu.inc:0
[03-May-2008 14:23:23] PHP 5. view->preview() /Applications/MAMP/htdocs/port/drupal/sites/all/modules/views/includes/admin.inc:343
If I then save the view and navigate to the actual page (view_error), I get a WSOD and the following errors in my php_error.log file:
[03-May-2008 14:23:47] PHP Fatal error: Call to a member function pre_execute() on a non-object in /Applications/MAMP/htdocs/port/drupal/sites/all/modules/views/includes/view.inc on line 672
[03-May-2008 14:23:47] PHP Stack trace:
[03-May-2008 14:23:47] PHP 1. {main}() /Applications/MAMP/htdocs/port/drupal/index.php:0
[03-May-2008 14:23:47] PHP 2. menu_execute_active_handler() /Applications/MAMP/htdocs/port/drupal/index.php:18
[03-May-2008 14:23:47] PHP 3. call_user_func_array() /Applications/MAMP/htdocs/port/drupal/includes/menu.inc:346
[03-May-2008 14:23:47] PHP 4. views_page() /Applications/MAMP/htdocs/port/drupal/includes/menu.inc:0
[03-May-2008 14:23:47] PHP 5. view->execute_display() /Applications/MAMP/htdocs/port/drupal/sites/all/modules/views/views.module:231
[03-May-2008 14:23:47] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required './sites/all/modules/views/includes/admin.inc' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/port/drupal/sites/all/modules/views/views_ui.module on line 171
[03-May-2008 14:23:47] PHP Stack trace:
[03-May-2008 14:23:47] PHP 1. {main}() /Applications/MAMP/htdocs/port/drupal/index.php:0
[03-May-2008 14:23:47] PHP 2. menu_execute_active_handler() /Applications/MAMP/htdocs/port/drupal/index.php:18
[03-May-2008 14:23:47] PHP 3. call_user_func_array() /Applications/MAMP/htdocs/port/drupal/includes/menu.inc:346
[03-May-2008 14:23:47] PHP 4. views_page() /Applications/MAMP/htdocs/port/drupal/includes/menu.inc:0
[03-May-2008 14:23:47] PHP 5. view->execute_display() /Applications/MAMP/htdocs/port/drupal/sites/all/modules/views/views.module:231
[03-May-2008 14:23:47] PHP 6. devel_shutdown_real() /Applications/MAMP/htdocs/port/drupal/sites/all/modules/devel/devel.module:0
[03-May-2008 14:23:47] PHP 7. devel_query_summary() /Applications/MAMP/htdocs/port/drupal/sites/all/modules/devel/devel.module:632
[03-May-2008 14:23:47] PHP 8. t_safe() /Applications/MAMP/htdocs/port/drupal/sites/all/modules/devel/devel.module:722
[03-May-2008 14:23:47] PHP 9. t() /Applications/MAMP/htdocs/port/drupal/sites/all/modules/devel/devel.module:730
[03-May-2008 14:23:47] PHP 10. theme() /Applications/MAMP/htdocs/port/drupal/includes/common.inc:789
[03-May-2008 14:23:47] PHP 11. init_theme() /Applications/MAMP/htdocs/port/drupal/includes/theme.inc:563
[03-May-2008 14:23:47] PHP 12. _init_theme() /Applications/MAMP/htdocs/port/drupal/includes/theme.inc:60
[03-May-2008 14:23:47] PHP 13. _theme_load_registry() /Applications/MAMP/htdocs/port/drupal/includes/theme.inc:180
[03-May-2008 14:23:47] PHP 14. _theme_build_registry() /Applications/MAMP/htdocs/port/drupal/includes/theme.inc:226
[03-May-2008 14:23:47] PHP 15. _theme_process_registry() /Applications/MAMP/htdocs/port/drupal/includes/theme.inc:376
[03-May-2008 14:23:47] PHP 16. views_ui_theme() /Applications/MAMP/htdocs/port/drupal/includes/theme.inc:266
I have the following contrib modules installed: views, views_ui, advanced_help, schema, coder, devel, code filter, cvs deploy, project, cvs integration.
The exported view I created following the instructions above is:
$view = new view;
$view->name = 'error';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = '0';
$view->api_version = 2;
$view->disabled = FALSE; // Edit this to true to make a default view disabled initially
$view->display = array();
$display = new views_display;
$display->id = 'default';
$display->display_title = 'Defaults';
$display->display_plugin = 'default';
$display->position = '1';
$display->display_options = array (
'style_plugin' => 'default',
'style_options' =>
array (
),
'row_plugin' => 'fields',
'row_options' =>
array (
),
'relationships' =>
array (
),
'fields' =>
array (
'title' =>
array (
'id' => 'title',
'table' => 'node',
'field' => 'title',
'label' => 'Title',
'relationship' => 'none',
'link_to_node' => 0,
),
),
'sorts' =>
array (
),
'arguments' =>
array (
),
'filters' =>
array (
),
'items_per_page' => 10,
);
$view->display['default'] = $display;
$display = new views_display;
$display->id = 'page';
$display->display_title = 'Page';
$display->display_plugin = 'page';
$display->position = '2';
$display->display_options = array (
'defaults' =>
array (
'access' => true,
'title' => true,
'header' => true,
'header_format' => true,
'header_empty' => true,
'footer' => true,
'footer_format' => true,
'footer_empty' => true,
'empty' => true,
'empty_format' => true,
'use_ajax' => true,
'items_per_page' => true,
'offset' => true,
'use_pager' => true,
'pager_element' => true,
'use_more' => true,
'distinct' => true,
'link_display' => true,
'style_plugin' => true,
'style_options' => true,
'row_plugin' => true,
'row_options' => true,
'relationships' => true,
'fields' => true,
'sorts' => true,
'arguments' => true,
'filters' => true,
),
'relationships' =>
array (
),
'fields' =>
array (
),
'sorts' =>
array (
),
'arguments' =>
array (
),
'filters' =>
array (
),
'path' => 'view_error',
);
$view->display['page'] = $display;
$display = new views_display;
$display->id = 'attachment';
$display->display_title = 'Attachment';
$display->display_plugin = 'attachment';
$display->position = '3';
$display->display_options = array (
'defaults' =>
array (
'access' => true,
'title' => true,
'header' => true,
'header_format' => true,
'header_empty' => true,
'footer' => true,
'footer_format' => true,
'footer_empty' => true,
'empty' => true,
'empty_format' => true,
'use_ajax' => true,
'items_per_page' => true,
'offset' => true,
'use_pager' => true,
'pager_element' => true,
'use_more' => true,
'distinct' => true,
'link_display' => true,
'style_plugin' => true,
'style_options' => true,
'row_plugin' => true,
'row_options' => true,
'relationships' => true,
'fields' => true,
'sorts' => true,
'arguments' => true,
'filters' => true,
),
'relationships' =>
array (
),
'fields' =>
array (
),
'sorts' =>
array (
),
'arguments' =>
array (
),
'filters' =>
array (
),
'attachment_position' => 'before',
'inherit_arguments' => true,
'displays' =>
array (
'page' => 'page',
'default' => 0,
),
);
$view->display['attachment'] = $display;
There are some error messages in my apache_error_log file that are due to views, but those seem to be unrelated to this issue at hand because following the steps above does not lead to new messages in that error log file.
Comments
Comment #1
merlinofchaos commentedThis should be fixed in dev now.
If you have other messages in your error log due to Views, please report them; I'm trying to keep Views perfectly notice free but it's really easy to miss stuff.
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.