Trying to add a exposed filter to a view.

When I get to the last step and click apply I get:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/views/ajax/config-item/media_default/media_browser_1/filter/field_related_release_target_id
StatusText: parsererror
ResponseText: Notice: Undefined index:  identifier in is_identifier_unique() (line 2674 of /sites/all/modules/views/plugins/views_plugin_display.inc). =>

Any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tsvenson’s picture

Haven't seen anything like this when creating views using the File Entity and Media modules. Are you overriding a view Media comes with or creating a new? Which version of Media/File Entity do you use?

madeby’s picture

I use latest DEV versions and is overwriting the view already their.

yurg’s picture

Got same bug at http://s.com/index.php?q=admin/structure/views/ajax/config-item/front/pa...

Notice: Undefined index: identifier in views_plugin_display->is_identifier_unique() (line 2674 of /sites/all/modules/views/plugins/views_plugin_display.inc).

Using 3 exposed filters in conjunction with Better Exposed Filter module and AJAX. Since initial thread is several months old it may be one of Views mysteries which will be not clearly reproduced and resolved. So, leaving record just for note.

gunwald’s picture

I have exactly the same problem.

dgastudio’s picture

same here

markdatter’s picture

I get the AJAX error when I am trying to save the filters in the Views administration interface.
- I am not using AJAX for the View
- I am not using Better Exposed Filters.
- I am using OpenLayers mapping and proximity filtering.
- I have 4 displays: OpenLayers Data Overlay, OpenLayers Map (2x), Table

Yaron Tal’s picture

I got the same problem. What fixed it for me was adding an isset() to the is_identifier_unique() method.
I doubt this is a real fix though. I guess the problem is with the handler not defining a unique identifier.
For those having the same problem and in need of a suppression of the error (i guess it's kinda like that);
In is_identifier_unique() find this line:

if ($id != $key && $identifier == $handler->options['expose']['identifier']) {

and replace it with:

if (isset($handler->options['expose']['identifier']) && $id != $key && $identifier == $handler->options['expose']['identifier']) {

Since I don't think this is a bug in this function, but more likely something in the handlers I didn't make a patch of the above. I hope a views maintainer can shed a light on this?

For completeness, relevant modules:
Media-7.x-2.x - last git comit: 41028b10191dc1a9901bb21c163d4f61ddc96eb8
Views 7.x-3.7
Ctools 7.x-1.3

I got the error when adding a taxonomy exposed filter to the default media gallery view.

Anybody’s picture

Issue summary: View changes

Same problem here, the issue is still active.

rahafrouz’s picture

having same problem here, a view with some exposed filters.

donquixote’s picture

Same problem here.
The "bad" handler in my case is a views_handler_sort_date sort handler.
It has a $handler->options['expose'] with 'label' and 'order', but without an 'identifier'.

The backtrace:
14: views_plugin_display->is_identifier_unique()
13: views_handler_filter->expose_validate()
12: views_handler_filter->options_validate()
11: views_handler_filter_date->options_validate()
10: views_ui_config_item_form_validate()
9: form_execute_handlers()
8: _form_validate()
7: drupal_validate_form()
6: drupal_process_form()
5: drupal_build_form()
4: views_ajax_form_wrapper()
3: views_ui_ajax_form()
2: call_user_func_array()
1: menu_execute_active_handler()
0: main()

gifad’s picture

Simple patch to fix the issue (based on #7).

interdruper’s picture

Status: Needs review » Reviewed & tested by the community

#11 works, avoiding the annoying AJAX error.

Pretty sure that the error is just a side-effect, but this 'defensive' patch is not harmful at all.

DamienMcKenna’s picture

This seems safe.

  • DamienMcKenna committed 78ecd55 on 7.x-3.x authored by gifad
    Issue #1456836 by gifad: Verify the "identifier" variable exists in...
DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.