Fatal error when forwarding a view
orianasarac - July 6, 2009 - 22:39
| Project: | Forward |
| Version: | 6.x-1.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
When attempting to forward a view, the following error occurs:
Fatal error: Unsupported operand types in /includes/common.inc on line 1552
In a different testing environment, I get the following warning instead and the forward fails:
# warning: Illegal offset type in isset or empty in /includes/menu.inc on line 310.
# warning: Illegal offset type in isset or empty in /includes/path.inc on line 166.
# warning: Illegal offset type in /includes/path.inc on line 167.
# warning: Illegal offset type in /includes/path.inc on line 170.
# warning: array_slice() expects parameter 1 to be array, null given in /includes/menu.inc on line 312.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: menu_get_item /* USERNAME : menu_get_item */ SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /includes/menu.inc on line 315.
...
The requested page could not be found. Forwarding any custom or built-in types (page, blog, etc.) works with no problem. Thanks for your help.

#1
confirming that i am getting this error also.
#2
I'm getting this as well.
#3
Could you please export your view and post that code here? I did find one bug but it wasn't causing a fatal error.
#4
I have the same problem with multiple views.
An example (error message and view export):
Edit: the path that produces the error look like this: /forward?path=taxonomy/term/3
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/menu.inc on line 310.* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/path.inc on line 166.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 167.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 170.
* warning: array_slice(): The first argument should be an array in /var/www/virtual/drupal6/includes/menu.inc on line 312.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/www/virtual/drupal6/includes/menu.inc on line 315.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 326.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 328.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/menu.inc on line 310.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/path.inc on line 166.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 167.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 170.
* warning: array_slice(): The first argument should be an array in /var/www/virtual/drupal6/includes/menu.inc on line 312.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/www/virtual/drupal6/includes/menu.inc on line 315.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 326.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 328.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/menu.inc on line 310.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/path.inc on line 166.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 167.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 170.
* warning: array_slice(): The first argument should be an array in /var/www/virtual/drupal6/includes/menu.inc on line 312.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/www/virtual/drupal6/includes/menu.inc on line 315.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 326.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 328.
* warning: preg_match() expects parameter 2 to be string, array given in /var/www/virtual/drupal6/includes/bootstrap.inc on line 811.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/menu.inc on line 310.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/path.inc on line 166.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 167.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 170.
* warning: array_slice(): The first argument should be an array in /var/www/virtual/drupal6/includes/menu.inc on line 312.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/www/virtual/drupal6/includes/menu.inc on line 315.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 326.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 328.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/menu.inc on line 310.
* warning: Illegal offset type in isset or empty in /var/www/virtual/drupal6/includes/path.inc on line 166.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 167.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/path.inc on line 170.
* warning: array_slice(): The first argument should be an array in /var/www/virtual/drupal6/includes/menu.inc on line 312.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/www/virtual/drupal6/includes/menu.inc on line 315.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 326.
* warning: Illegal offset type in /var/www/virtual/drupal6/includes/menu.inc on line 328.
$view = new view;$view->name = 'taxonomy_term_uva';
$view->description = 'taxonomy/term defined in uva_common, for term listings.';
$view->tag = 'default';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('sorts', array(
'sticky' => array(
'id' => 'sticky',
'table' => 'node',
'field' => 'sticky',
'order' => 'DESC',
'relationship' => 'none',
),
'created' => array(
'id' => 'created',
'table' => 'node',
'field' => 'created',
'order' => 'DESC',
'granularity' => 'second',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'term_node_tid_depth' => array(
'id' => 'term_node_tid_depth',
'table' => 'node',
'field' => 'term_node_tid_depth',
'default_action' => 'not found',
'style_plugin' => 'default_summary',
'style_options' => array(
'count' => TRUE,
'override' => FALSE,
'items_per_page' => 25,
),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'taxonomy_term',
'validate_fail' => 'not found',
'depth' => '0',
'break_phrase' => 1,
'relationship' => 'none',
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'album' => 0,
'artist' => 0,
'book' => 0,
'page' => 0,
'story' => 0,
'track' => 0,
),
'validate_argument_vocabulary' => array(
'3' => 0,
'4' => 0,
'1' => 0,
'5' => 0,
'2' => 0,
),
'validate_argument_type' => 'tids',
'validate_argument_php' => '',
),
'term_node_tid_depth_modifier' => array(
'id' => 'term_node_tid_depth_modifier',
'table' => 'node',
'field' => 'term_node_tid_depth_modifier',
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(
'count' => TRUE,
'override' => FALSE,
'items_per_page' => 25,
),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'operator' => '=',
'value' => '',
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
'role' => array(),
'perm' => '',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('use_pager', '1');
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'teaser' => TRUE,
'links' => TRUE,
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('items_per_page', 2);
$handler->override_option('use_pager', '0');
$handler->override_option('path', 'taxonomy/term/%');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler = $view->new_display('feed', 'Core feed', 'feed');
$handler->override_option('items_per_page', 15);
$handler->override_option('style_plugin', 'rss');
$handler->override_option('style_options', array(
'mission_description' => FALSE,
'description' => '',
));
$handler->override_option('row_plugin', 'node_rss');
$handler->override_option('row_options', array(
'item_length' => 'default',
));
$handler->override_option('path', 'taxonomy/term/%/%/feed');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler->override_option('displays', array(
'page' => 'page',
'default' => 0,
));
$handler->override_option('sitename_title', FALSE);
$handler = $view->new_display('block', 'Blok', 'block_1');
$handler->override_option('items_per_page', 50);
$handler->override_option('offset', 2);
$handler->override_option('use_pager', '0');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
#5
This issue seems to be caused by the path being an array structure if we are dealing with a view. Patch attached to take this into account.
#6
That's strange - I've been trying to chase down this bug for some time without success (never was able to even reproduce it). I also can;t imagine why that would have ended up an array - it should always be a string. What was the actual path of your view?
#7
The value I was getting was array([0] => 'path-name') where as the view itself was situated at 'path-name'. This was a view with a default display, and a page display. The page display exposes no menu items.
By path-name I mean that the path is split in 2 by a -.
#8
Figured it out. The problem actually occurs a few lines up. Didn't figure it out earlier because I apparently had the branches screwed up on my local copy after my last Windows upgrade. Sorry for the delay. It'll be fixed in the next release (later today).
#9
Automatically closed -- issue fixed for 2 weeks with no activity.