HOW-TO: Resolve Unexpected error with Views grouped filter

 

When you develop with Drupal 8.2.x/8.3.x and save the view with not "string" based group filter, you get an error on your screen says:

The website encountered an unexpected error. Please try again later.

And you also find an error warning in the log message:

InvalidArgumentException: The configuration property display.default.display_options.filters.field_options_value.group_info.group_items.1.value.type doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get()

You will need this patch addressed on drupal.org https://www.drupal.org/node/2369119#comment-11755386

Reproduce the issue:

I have a date field to be filtered in a views display, and want to use the grouped filter for user to filter items within "Today", "Tomorrow" and "This Month"

This select list is made of a date field with a views gruoped filter

When I save the Views, it gives me an error and wipe out the entire site.

If you looking up the Log message in the report section, you may also find a error with PHP

This is due to the fact that the grouped filter value schema is always a string. The patch in the issue will update the handler of the grouped filter and allow non-string gruped filtered to be saved.