Repeatable: Always
Steps to repeat:

  1. have shs module installed (error does not occur when shs is uninstalled)
  2. create a view (as simple as possible)
  3. add filter criteria "has taxonomy term", select the vocabulary to use, select any of the selection types
  4. choose 'is one of' and select a term, press apply
  5. check the preview panel of the view is working correctly (see attached screenshots of the view setup)
  6. save the view
  7. error thrown

Expected Results:
The view saves.

Actual results:
On save, error is thrown: The website encountered an unexpected error. Please try again later.

InvalidArgumentException: The configuration property display.default.display_options.filters.field_report_type_target_id.value.0 doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 74 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

Error when trying to add a taxonomy term filter to a view, with a specified term when created with the UI. After adding the filter the preview on the view works correctly but after clicking save it throws this error:

I have tried various things to try to fix it, none of which work:
• using different taxonomies
• using the taxonomy term filter rather than the specific taxonomy field filter
• deleting the taxonomy, recreating it and readding filter
• creating a new simple view with just the content type filter and title field and adding the filter
• changing selection modes for the taxonomy term within the filter (dropdown, autofill, shs etc.)

If you add the filter with no specified term and expose the filter the view will save and it works correctly. If you expose the filter and select a term it throws the error. If you don’t expose the filter and select a term it throws the error.

I have found a few conversations around this:
https://www.drupal.org/node/2875656 see comment #7.
https://www.drupal.org/node/2369119 which is a different bug, but towards the end of the comments this error is talked about.

I does not seem to be a core issue as others have tested with a clean install.

When I uninstalled the shs module, went back to the view and added the filter the view saves and works correctly. So it seems like shs is causing the problem.

We are using 8.3.4. We didn’t seem to have this issue before updating to 8.3. I wonder if it is linked to comment #10 on https://www.drupal.org/node/2875656. Could shs be causing invalid config that is not ok with the updates in 8.3?

Any help on this would be really appreciated. Has anyone else experienced this?

CommentFileSizeAuthor
#2 2890274-2.patch6.11 KBgodotislate
Screen Shot 2017-06-28 at 10.29.30.png159.33 KBAnonymous (not verified)
Screen Shot 2017-06-28 at 10.29.11.png100.65 KBAnonymous (not verified)

Comments

Anonymous’s picture

JDalcorn created an issue. See original summary.

godotislate’s picture

Status: Active » Needs review
StatusFileSize
new6.11 KB

Here's a patch.

This simplifies how the SHS views filter plugin is added to the view by using hook_views_plugins_filter_alter() instead of the data_alter hooks. This also eliminates the need to change the module weight and the .install file.

I've found that even with SHS installed, now views with taxonomy filters that don't use SHS won't have the SHS dependency, either.

It also solves the issue of the view not saving as described.

stborchert’s picture

Status: Needs review » Fixed

Hi.
Thanks for the (very) detailed report and thanks also for the patch. I've committed the patch to 8.x-1.x.

Anonymous’s picture

Thank you for the fix, I've tested now and it's working

Status: Fixed » Closed (fixed)

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

sukanya.ramakrishnan’s picture

I am still having errors importing configs with view filters based on taxonomy in drupal 8.4 . Do we need schema definitions for the filters?

Thanks
Sukanya

sukanya.ramakrishnan’s picture

Created a child issue to address the schema error here !!

https://www.drupal.org/node/2897421