I'm trying to get date filters to work with this module but it just doesn't seem to work.

Reproduction steps:

  1. Create a content type (A) with a date field.
  2. Create a view with exposed filter of type 'between' on that date field.
  3. Create another content type (B) with a field_embed_views field, using that view.
  4. Create some test content (A) with different values for the date field.
  5. Create a node of type (B) and set the filter to any range.

Expected result:
Filter is saved and limits view results to the range.

Actual result:
Filter is saved, but not shown in the edit form (B) and thus emptied again on save.
View shows items with a date value outside the range.
Viewing node B give an error:

( ! ) Fatal error: Cannot create references to/from string offsets nor overloaded objects in /includes/common.inc on line 6727
Call Stack
#	Time	Memory	Function	Location
...
24	0.2217	14039600	render( )	.../field.tpl.php:62
25	0.2217	14039736	drupal_render( )	.../common.inc:6104
26	0.2218	14041872	theme( )	.../common.inc:6003
27	0.2249	15015296	theme_field_embed_views_formatter_default( )	.../theme.inc:1161
28	0.2250	15015728	view->preview( )	.../field_embed_views.module:152
29	0.2291	15571424	views_plugin_display->preview( )	.../view.inc:1368
30	0.2292	15571520	view->render( )	.../views_plugin_display.inc:2677
31	0.2292	15572536	view->execute( )	.../view.inc:1192
32	0.2292	15573064	view->build( )	.../view.inc:1124
33	0.2295	15587176	views_plugin_exposed_form->render_exposed_form( )	.../view.inc:965
34	0.2295	15588432	drupal_build_form( )	.../views_plugin_exposed_form.inc:161
35	0.2315	15661928	drupal_process_form( )	.../form.inc:385
36	0.2316	15665096	form_builder( )	.../form.inc:885
37	0.2316	15669280	form_builder( )	.../form.inc:1926
38	0.2317	15674456	form_builder( )	.../form.inc:1926
39	0.2403	15733376	form_builder( )	.../form.inc:1926
40	0.2404	15733920	_form_builder_handle_input_element( )	.../form.inc:1864
41	0.2404	15734488	drupal_array_set_nested_value( )	.../form.inc:2097


I did a lot of digging but I've become lost.
It appears to be that different date module functions are called when field_embed_views creates the filter and when views creates the filter.

Comments

JvE created an issue. See original summary.

JvE’s picture

JvE’s picture

Status: Active » Needs review
JvE’s picture

Status: Needs review » Needs work

This does solve the problem of date filter settings not being stored.
But it introduces the problem that the filters no longer work.
I'm going to dig deeper to find some way to create compatibility between this module and the date module.

JvE’s picture

Title: accept_exposed_input not being called causes issues with date views » Doesn't work with date filters
Issue summary: View changes
Status: Needs work » Active
JvE’s picture

Issue summary: View changes
JvE’s picture

StatusFileSize
new12.36 KB

I've added a Feature in bug2687589.zip that demonstrates the problem.
- enable feature.
- create a new TestContent node with something filled in for the filter.
- submit and crash

alexdoma’s picture

StatusFileSize
new708 bytes

patch above and this patch solve problem for me