In trying to set up the web widgets along with a view I got the following error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /en/admin/structure/views/view/mike_s_map_layer/preview/web_widgets_1/ajax
StatusText: OK
ResponseText: 
( ! ) Fatal error: Cannot use object of type view as array in /home/sccgoc/includes/theme.inc on line 963
Call Stack
#TimeMemoryFunctionLocation
10.0001273760{main}(  )../index.php:0
20.427683659608menu_execute_active_handler( $path = ???, $deliver = ??? )../index.php:21
30.438885885528call_user_func_array
( 'views_ui_build_preview', array (0 => class view { public $db_table = 'views_view'; public $base_table = 'node'; public $base_field = 'nid'; public $name = 'mike_s_map_layer'; public $vid = '14'; public $built = FALSE; public $executed = FALSE; public $editing = TRUE; public $args = array (...); public $build_info = array (...); public $use_ajax = FALSE; public $result = array (...); public $current_page = NULL; public $items_per_page = NULL; public $offset = NULL; public $total_rows = NULL; public $attachment_before = ''; public $attachment_after = ''; public $exposed_data = array (...); public $exposed_input = array (...); public $exposed_raw_input = array (...); public $old_view = array (...); public $parent_views = array (...); public $is_attachment = NULL; public $current_display = NULL; public $query = NULL; public $display_handler = NULL; public $display = array (...); public $style_plugin = NULL; public $override_url = NULL; public $override_path = NULL; public $base_database = NULL; public $description = ''; public $tag = 'default'; public $human_name = 'Mike\'s Map Layer'; public $core = '7'; public $table = 'views_view'; public $type = 'Normal'; public $export_type = 1; public $locked = FALSE; public $localization_plugin = class views_plugin_localization_core { ... }; public $relationships_fixed = TRUE; public $changed = TRUE; public $changed_display = array (...); public $disabled = FALSE; public $stack = array (...) }, 1 => 'web_widgets_1') )../menu.inc:517
...

Comments

mgifford’s picture

Possibly related but I get a "Fatal error: Cannot use object of type view as array in /DRUPAL7/includes/theme.inc on line 963" when I navigate to the path that I have defined for the widget.

HeathN’s picture

I get the same error.

ngreenup’s picture

I also get the same

    Notice: Undefined index: render element in theme() (line 974 of /home/clients/websites/username/public_html/grub/includes/theme.inc).
    Notice: Undefined index: path in template_preprocess_web_widgets_iframe() (line 54 of /home/clients/websites/username/public_html/grub/sites/all/modules/web_widgets/iframe/web_widgets_style_iframe.inc).

dlumberg’s picture

I changed starting on line 57 of web_widgets_plugin_display_web_widgets.inc

from

      // Fallback to default way
      // TODO Please change this theme call to use an associative array for the $variables parameter.
      $content = theme($this->theme_functions(), $this->view);

to

      // Fallback to default way
      $vars = array('view' => $this->view);
      $content = theme($this->theme_functions(), $vars);
askibinski’s picture

that worked!

floydm’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha1
Status: Active » Needs review
StatusFileSize
new1.08 KB

This fixed the views integration for me too. I needed to apply it again when I upgraded to the alpha1 release.

I've attached a patch.

floydm’s picture

StatusFileSize
new919 bytes

Sorry, new patch without junk about an image that got included in the same commit.

(My apologies, I'm new at submitting patches).

jacobpov’s picture

Still getting the following errors not on the widget display but the page itself when I attach it to the page.

Warning: Illegal string offset 'theme_hook_suggestions' in theme() (line 1099 of /var/www/includes/theme.inc).
Warning: Illegal string offset 'zebra' in template_preprocess() (line 2320 of /var/www/includes/theme.inc).
Warning: Illegal string offset 'id' in template_preprocess() (line 2321 of /var/www/includes/theme.inc).
Warning: Illegal string offset 'directory' in template_preprocess() (line 2324 of /var/www/includes/theme.inc).
Warning: Illegal string offset 'classes_array' in template_preprocess() (line 2327 of /var/www/includes/theme.inc).
Notice: Array to string conversion in template_preprocess() (line 2327 of /var/www/includes/theme.inc).

this is from the log

and nothing is displayed just a 500 fatal error with a blank page

FranciscoLuz’s picture

The patch on #7 fixed it for me, thank you Floydm.

PS: I also had to apply this patch here #1622870: Strict warning: Declaration of web_widgets_plugin_display_web_widgets::options_submit()

modctek’s picture

I couldn't get this patch to apply, it was failing with the following message:

Hunk #1 FAILED at 55.
1 out of 1 hunk FAILED -- saving rejects to file sites/all/modules/contrib/web_widgets/views/web_widgets_plugin_display_web_widgets.inc.rej

Perhaps because I don't have the "contrib" sub directory in my hierarchy? Applying the changes manually seems to have addressed the issue.

clemens.tolboom’s picture

Status: Needs review » Closed (duplicate)
clemens.tolboom’s picture

Title: An AJAX HTTP error occurred » An AJAX HTTP error occurred: Fatal error: Cannot use object of type view as array in ...