Hello,
I have a particularly complex view set, I am not convinced that the combination of modules is causing the issue I am reporting. However, I will do my best to explain the whole design pattern as it may provide insight into other issues.
Error Identified:
Notice: Undefined property: views_handler_field_field::$original_value in views_handler_field->render_text() (line 1118 of /srv/clients/example/code/sites/all/modules/contrib/views/handlers/views_handler_field.inc). Backtrace:
views_handler_field->render_text(Array) views_handler_field.inc:1065
views_handler_field->advanced_render(Object) theme.inc:354
template_preprocess_views_view_field(Array, 'views_view_field') theme.inc:1008
theme(Array, Array) views_handler_field.inc:1440
views_handler_field->theme(Object) views_plugin_style.inc:526
views_plugin_style->render_fields(Array) views_plugin_style.inc:431
views_plugin_style->render_grouping(Array, Array) openlayers_views_style_data.inc:25
openlayers_views_style_data->render(Array) openlayers_views_plugin_display_openlayers.inc:26
openlayers_views_plugin_display_openlayers->render() view.inc:1232
view->render() openlayers_views_plugin_display_openlayers.inc:18
openlayers_views_plugin_display_openlayers->execute() view.inc:1313
view->execute_display('members_map_openlayers_data', Array) openlayers_views_vector.inc:63
openlayers_layer_type_openlayers_views_vector->get_features('member_index_map', 'members_map_openlayers_data') openlayers_views_vector.inc:80
openlayers_layer_type_openlayers_views_vector->render(Array) openlayers.render.inc:39
_openlayers_layers_process(Array, Array) openlayers.module:168
openlayers_build_map(Array) openlayers.module:201
openlayers_render_map_data(Array, 'member_index_map') openlayers.module:264
openlayers_render_map(Object, 'member_index_map') openlayers_views_style_map.inc:66
openlayers_views_style_map->render(Array) theme.inc:49
template_preprocess_views_view(Array, 'views_view') theme.inc:1008
theme(Array, Array) views_plugin_display.inc:2561
views_plugin_display->render() view.inc:1232
view->render() views_plugin_display_page.inc:229
views_plugin_display_page->execute() view.inc:1313
view->execute_display('members_map_openlayers_map', Array) views.module:475
views_page('member_index_map', 'members_map_openlayers_map')
call_user_func_array('views_page', Array) menu.inc:517
menu_execute_active_handler() index.php:21
0) Entity
I have an entity called "member" that has a "sub-entity" curtesy of the field collection module (http://drupal.org/project/field_collection) that contains a 3 field entity attached to the "member" parent. Because of the embedded entity I have had to add a relationship between the parent and child entities. I have accomplished the integration correctly and the data is displayed both in lists of members and in filters based on the relationship.
1) Openlayers
I have setup an open layers map and the view in question has a "OpenLayers Data Overlay". This view format appears to be working as designed. The fields and filters all work fine and provide the JSON structure required for the Open Layers map to render.
2) Page View
The page view provides a rendering display for the Open Layers data overlay it contains exactly the same fields and filters as the Openlayers Data Overlay view. The filters are exposed and I can successfully filter records by multiple criteria from text fields, taxonomy and node reference relationships.
3) Attachment View
This is where things go a little off the rails.
The attachment contains all of the same fields and filters as the parent views both "Openlayers Data" and the "page view". It's job is to list all of the member records that are being used in the Map rendered on the "page view". As the user selects filters the list should reflect the sub-select that is displayed on the map.
On or more filters appear to be unhappy, the first is a taxonomy reference field that displays none or more terms. The field is of type autocomplete and can be empty. The error being generated in the attachment leads me to believe that the handler for this field is not validating correctly and not excluding it from the query (please reference the error above).
I have found it difficult to try and configure the filter to reproduce the error during configuration or from within the view preview. Viewing the attachment view directly in the Views UI it will render as expected without any errors. The attachment will not render in the "map page view" although the view does show the wrapper where the attachment should be rendered.
My next course of action is to attempt to try the following:
1) Modify the default view handler and trace where the error occurs, is it in Openlayers view or is it in the core code of Views?
2) Write a hook to intercept the specific field on the attachment view and clobber it should it be empty.
Please provide any recommendations or patches that may already exist related to this issue.
Comments
Comment #1
emptyvoid commentedFollow up, under closer inspection of the query generated for the attachment view I have confirmed that the "product_services" filter field is the problem.
Current Query:
The desired behavior is to exclude the field_data_field_member_product_services field from the inner join and where clauses of the query if it is empty. It is especially troubling is that the "where" clause also uses "=" when the field is a one to many relationship. If anything I would expect it to look like:
If the filter had values.
I am going to try and track down the hooks required to modify the pre_render and or a hook explicitly for the filter.
Comment #2
emptyvoid commentedFor future reference the following page provides a description on how to target a specific filter and modify it.
http://views-help.doc.logrus.com/help/views/alter-exposed-filter
Comment #3
johnvSee this issue, which treats the error message: #1548240: this->original_value does not always exist in views_handler_field->render_text() (line 1118
Comment #4
emptyvoid commentedThanks jonv for the pointing me to the issue. I have applied the patch but it didn't fix the issue I am having.
I'll post if the solution required either a) reconfiguring the field or b) writing a special hook to override the behavior.
Comment #5
johnvSome other options:
- are your views cached? If so, disabled that and test again. see e.g. #1055616: Query arguments should be replaced before generating cache ID
- there are some issues with taxonomy filters:
#1430650: Taxonomy filter with depth, Drupal 7.12, and views query caching failure
#1430396: adding related taxonomy term to fields when using "Has taxonomy term ID (with depth)" filter leads to empty result
good luck!
Comment #6
sebsebseb123 commentedHey hey, in case anyone else is having the issue of no results showing up... I found a work around.
My setup is:
- D7
- Views 3
- openlayers 2-beta
- openlayers_proximity 2-dev
My view is as described above... map, with attachment.
I tried some patches that were mentioned in this thread... none seemed to work too well. I figured out this work around using form_alter and custom validation.
Basically, the view filter is expecting term IDs... integer numbers... with autocomplete selected, the view filter gets a text string... so, at form validate I manually explode the string, then create my own tid array. Here's some sample code that worked: