What I need:
To build a view showing a map (Open layers) listing all nodes (each node includes a geofield point) on the map. That works fine as long as I use as "Content" directly as a type of the view. However when I use Solr Search Index as a base table for the same view (in order to filter the nodes using facet search), I get an error.

How I reproduce the error:

  1. I build a view based on the SolrSearch Index (indexes nodes with geofields - each node has one geofield to store location).
  2. In the view, I add field (WKT of the geofield).
  3. Add OpenLayers Data overlay, and set up that overlay to use the WKT geofield as a map data source
  4. Add another page to the views, and choose a format of OpenLayers Map.
  5. that gives the following error:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /austat06/admin/structure/views/view/solrview/preview/page/ajax
StatusText: Internal Server Error
ResponseText:

and when I look in the Apache Log, there is this:

PHP Fatal error: Cannot access protected property SearchApiViewsQuery::$fields in /var/www/austat06/sites/all/modules/openlayers/modules/openlayers_views/views/openlayers_views_style_map.inc on line 50, referer: http://localhost/austat06/

Here are the following modules I use:

  • geofield 7.x-1.0-beta1
  • openlayers 7.x-2.x-dev
  • searchApi 7.x-1.0-rc1
  • searchApiSolr 7.x-1.0-rc1
  • Views 7.x-3.0-rc1
  • Core 7.9
  • Solr 3.4

The Export of the view is:

$view = new view;
$view->name = 'solrview';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'search_api_index_solrxiindex';
$view->human_name = 'SolrView';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'SolrViewXi';
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'table';
/* Field: Node: Node ID */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'search_api_index_solrxiindex';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
/* Field: Node: Geofield » Well-known text */
$handler->display->display_options['fields']['field_geofield_wkt']['id'] = 'field_geofield_wkt';
$handler->display->display_options['fields']['field_geofield_wkt']['table'] = 'search_api_index_solrxiindex';
$handler->display->display_options['fields']['field_geofield_wkt']['field'] = 'field_geofield_wkt';
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_geofield_wkt']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_geofield_wkt']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_geofield_wkt']['link_to_entity'] = 0;

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'openlayers_map';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['path'] = 'solrview';

/* Display: OpenLayers Data Overlay */
$handler = $view->new_display('openlayers', 'OpenLayers Data Overlay', 'openlayers_1');
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'openlayers_data';
$handler->display->display_options['style_options']['data_source'] = array(
'value' => 'wkt',
'other_lat' => 'nid',
'other_lon' => 'nid',
'wkt' => 'field_geofield_wkt',
'other_top' => 'nid',
'other_right' => 'nid',
'other_bottom' => 'nid',
'other_left' => 'nid',
'name_field' => '',
'description_field' => '',
);
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['defaults']['row_options'] = FALSE;

if I attempt to save the view after the "ajax error" appears, i get WSOD. So I can't really export the whole view.

I consider myself as a drupal user, but my knowledge is rather weak. Hope this will be enough info for someone else to help me out.

PS: (I tried many variations of development and stable module versions , but I always get the same error).

Any help would be very appreciated.

Thank you.

Comments

nod_’s picture

zzolo’s picture

Status: Active » Closed (duplicate)

Yes this is the same issue. Marking as duplicate.

@martin kostir, thank you so much for detailed information. Though it may not help too much with this particular issue, it is always really helpful to get good debugging information like that.

Issue now at #1340888: Protected $fields kills OpenLayers module