Problem/Motivation

Create a node based view. Add a node type exposed filter having the settings as in the screenshot or attached test.

Save the view. Boom!!!

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, views_filters_test.patch, failed testing.

Danny.Wouters’s picture

Assigned: Unassigned » Danny.Wouters
Issue tags: +DUGBE2410

I will try to find a solution for the failed test.

Danny.Wouters’s picture

Assigned: Danny.Wouters » Unassigned

I am able to reproduce the issue but I have no idea what it is causing the problem.

UpTil4Music’s picture

added one node each of article and page
add content view
add filter criteria
--side issue bug? "Type - Content" shows up twice in the list (as do others) when filtering for "type", selected 1st instance

added filter, rolls to "Add filter criteria" dialog instead of "Configure filter criterion: Content: Type"
filter is added (type Unknown)

reselect filter to configure
selected three values per the issue
Apply - gives warning "The title is required if value for this item is defined."
Titles are now blank, were "1st, 2nd, 3rd" when submitted - what?
Added titles back - apply

Filter shows in preview
View filter works in preview
save - Boom!

Multiple error messages:

Location http://localhost:8080/admin/structure/views/view/2595027/preview/page_1?...
Referrer http://localhost:8080/admin/structure/views/view/2595027
Message User error: "preview" is an invalid render array key in Drupal\Core\Render\Element::children() (line 102 of /drupal/docroot/core/lib/Drupal/Core/Render/Element.php).

    foreach ($elements as $key => $value) {
      if ($key === '' || $key[0] !== '#') {
        if (is_array($value)) {
          if (isset($value['#weight'])) {
            $weight = $value['#weight'];
            $sortable = TRUE;
          }
          else {
            $weight = 0;
          }
          // Supports weight with up to three digit precision and conserve
          // the insertion order.
          $child_weights[$key] = floor($weight * 1000) + $i / $count;
        }
        // Only trigger an error if the value is not null.
        // @see https://www.drupal.org/node/1283892
        elseif (isset($value)) {
          trigger_error(SafeMarkup::format('"@key" is an invalid render array key', array('@key' => $key)), E_USER_ERROR);
        }
      }
      $i++;
    }

Location http://localhost:8080/admin/structure/views/view/2595027
Referrer http://localhost:8080/admin/structure/views/view/2595027
Message InvalidArgumentException: The configuration property display.default.display_options.filters.type.group_info.group_items.1.value.all doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 79 of /drupal/docroot/core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

  public function get($name) {
    $parts = explode('.', $name);
    $root_key = array_shift($parts);
    $elements = $this->getElements();
    if (isset($elements[$root_key])) {
      $element = $elements[$root_key];
      // If $property_name contained a dot recurse into the keys.
      while ($element && ($key = array_shift($parts)) !== NULL) {
        if ($element instanceof TypedConfigInterface) {
          $element = $element->get($key);
        }
        else {
          $element = NULL;
        }
      }
    }
    if (isset($element)) {
      return $element;
    }
    else {
      throw new \InvalidArgumentException("The configuration property $name doesn't exist.");
    }
  }
UpTil4Music’s picture

Follow up issue:
While playing around with this view to see what else I could find out, I noticed the first added option for the type value "Select all" didn't actually work on the view. The default <Any> works, as do the other two options. So I deleted the first option.

Next, I tried to add another option to the list, but no option is added and I get an error message "An illegal choice has been detected. Please contact the site administrator." Details from the log:

Location 	http://localhost:8080/admin/structure/views/ajax/handler/2595027/page_1/filter/type?_wrapper_format=drupal_ajax
Referrer 	http://localhost:8080/admin/structure/views/view/2595027
Message 	Illegal choice 1 in options element.

mradcliffe thinks he has an uncommitted D7 views patch that may address the issue.

The json from http://localhost:8080/admin/structure/views/ajax/handler/2595027/page_1/... is:


[
  {
    "command": "settings",
    "settings": {
      "pluralDelimiter": "\u0003",
      "ajaxPageState": {
        "libraries": "core\/drupal.collapse,core\/drupal.dialog.ajax,core\/drupal.states,core\/drupal.tabledrag,core\/drupal.tableresponsive,core\/jquery.form",
        "theme": "seven",
        "theme_token": "-9q3TepOkWSHOOpXw7zNs7ozYe4VG3s0HpiLCoiT24M"
      },
      "ajaxTrustedUrl": {
        "form_action_cc611e1d": true,
        "\/admin\/structure\/views\/ajax\/handler\/2595027\/page_1\/filter\/type": true,
        "_empty_": true
      },
      "ajax": {
        "edit-remove": {
          "url": "\/admin\/structure\/views\/ajax\/handler\/2595027\/page_1\/filter\/type",
          "event": "mousedown",
          "keypress": true,
          "prevent": "click",
          "dialogType": "ajax",
          "submit": {
            "_triggering_element_name": "op",
            "_triggering_element_value": "Remove"
          }
        },
        "edit-cancel": {
          "path": {
            
          },
          "event": "mousedown",
          "keypress": true,
          "prevent": "click",
          "url": null,
          "dialogType": "ajax",
          "submit": {
            "_triggering_element_name": "op",
            "_triggering_element_value": "Cancel"
          }
        },
        "edit-submit-views-ui-config-item-form": {
          "url": "\/admin\/structure\/views\/ajax\/handler\/2595027\/page_1\/filter\/type",
          "event": "mousedown",
          "keypress": true,
          "prevent": "click",
          "dialogType": "ajax",
          "submit": {
            "_triggering_element_name": "op",
            "_triggering_element_value": "Apply"
          }
        }
      },
      "tableDrag": {
        "views-filter-groups": {
          "weight": [
            {
              "target": "weight",
              "source": "weight",
              "relationship": "sibling",
              "action": "order",
              "hidden": true,
              "limit": 0
            }
          ]
        }
      },
      "user": {
        "uid": "1",
        "permissionsHash": "744dd01d8ded577708bc328cd4bd1e2322bd4ae69ccf5deb6157ed5025096515"
      }
    },
    "merge": true
  },
  {
    "command": "add_css",
    "data": "<link rel=\"stylesheet\" href=\"http:\/\/localhost:8080\/sites\/default\/files\/css\/css_GbqoZKrfdFVs5aUO5RwZyblVxY7_sEWpN4lfTOM8CTI.css?0\" media=\"all\" \/>\n<link rel=\"stylesheet\" href=\"http:\/\/localhost:8080\/sites\/default\/files\/css\/css_xK8wL3HfAOJ3H9GOv2lb2_aS2HghUcjztJ6OjWmGxO8.css?0\" media=\"all\" \/>\n"
  },
  {
    "command": "insert",
    "method": "prepend",
    "selector": "head",
    "data": "<script src=\"http:\/\/localhost:8080\/core\/assets\/vendor\/modernizr\/modernizr.min.js?v=3.1.0\"><\/script>\n",
    "settings": null
  },
  {
    "command": "insert",
    "method": "append",
    "selector": "body",
    "data": "<script src=\"http:\/\/localhost:8080\/sites\/default\/files\/js\/js_PCmJvY79rKVgI0p5FtaLv13unnbTMcAXznKe_1jxkJI.js\"><\/script>\n",
    "settings": null
  },
  {
    "command": "openDialog",
    "selector": "#drupal-modal",
    "settings": null,
    "data": "<div class=\"views-messages\">\n<\/div><form data-drupal-selector=\"views-ui-config-item-form-2\" action=\"\/admin\/structure\/views\/ajax\/handler\/2595027\/page_1\/filter\/type\" method=\"post\" id=\"views-ui-config-item-form--2\" accept-charset=\"UTF-8\">\n  <div class=\"views-override clearfix form--inline views-offset-top\" data-drupal-views-offset=\"top\"><div class=\"js-form-item form-item js-form-type-select form-type-select js-form-item-override-dropdown form-item-override-dropdown\">\n      <label for=\"edit-override-dropdown\">For<\/label>\n        <select data-drupal-selector=\"edit-override-dropdown\" id=\"edit-override-dropdown\" name=\"override[dropdown]\" class=\"form-select\"><option value=\"default\">All displays<\/option><option value=\"page_1\">This page (override)<\/option><\/select>\n        <\/div>\n<\/div><div class=\"scroll js-form-wrapper form-wrapper\" data-drupal-views-scroll data-drupal-selector=\"edit-options\" id=\"edit-options\"><div class=\"js-form-item form-item description js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-options-form-description\" id=\"edit-options-form-description\">The node type.<\/div>\n\n<div class=\"views-expose clearfix\"><div class=\"js-only js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-options-expose-button-checkbox\" id=\"edit-options-expose-button-checkbox\"><div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-expose-button-checkbox-checkbox form-item-options-expose-button-checkbox-checkbox\">\n        <input data-drupal-selector=\"edit-options-expose-button-checkbox-checkbox\" type=\"checkbox\" id=\"edit-options-expose-button-checkbox-checkbox\" name=\"options[expose_button][checkbox][checkbox]\" value=\"1\" checked=\"checked\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-expose-button-checkbox-checkbox\" class=\"option\">Expose this filter to visitors, to allow them to change it<\/label>\n      <\/div>\n<\/div>\n<div class=\"description exposed-description\">This filter is exposed. If you hide it, users will not be able to change it.<\/div><input class=\"use-ajax-submit button js-form-submit form-submit\" data-drupal-selector=\"edit-options-expose-button-button\" formnovalidate=\"formnovalidate\" type=\"submit\" id=\"edit-options-expose-button-button\" name=\"op\" value=\"Hide filter\" \/>\n<\/div>\n<div class=\"views-grouped clearfix\"><div class=\"js-only js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-options-group-button-radios\" id=\"edit-options-group-button-radios\"><fieldset data-drupal-selector=\"edit-options-group-button-radios-radios\" aria-describedby=\"edit-options-group-button-radios-radios--wrapper--description\" id=\"edit-options-group-button-radios-radios--wrapper\" class=\"fieldgroup form-composite js-form-item form-item js-form-wrapper form-wrapper\">\n      <legend>\n    <span class=\"fieldset-legend\">Filter type to expose<\/span>\n  <\/legend>\n  <div class=\"fieldset-wrapper\">\n            <div id=\"edit-options-group-button-radios-radios\" class=\"form-radios\"><div class=\"js-form-item form-item js-form-type-radio form-type-radio js-form-item-options-group-button-radios-radios form-item-options-group-button-radios-radios\">\n        <input data-drupal-selector=\"edit-options-group-button-radios-radios-0\" aria-describedby=\"edit-options-group-button-radios-radios--description\" type=\"radio\" id=\"edit-options-group-button-radios-radios-0\" name=\"options[group_button][radios][radios]\" value=\"0\" class=\"form-radio\" \/>\n\n        <label for=\"edit-options-group-button-radios-radios-0\" class=\"option\">Single filter<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-radio form-type-radio js-form-item-options-group-button-radios-radios form-item-options-group-button-radios-radios\">\n        <input data-drupal-selector=\"edit-options-group-button-radios-radios-1\" aria-describedby=\"edit-options-group-button-radios-radios--description\" type=\"radio\" id=\"edit-options-group-button-radios-radios-1\" name=\"options[group_button][radios][radios]\" value=\"1\" checked=\"checked\" class=\"form-radio\" \/>\n\n        <label for=\"edit-options-group-button-radios-radios-1\" class=\"option\">Grouped filters<\/label>\n      <\/div>\n<\/div>\n\n              <div id=\"edit-options-group-button-radios-radios--wrapper--description\" class=\"description\">Grouped filters allow a choice between predefined operator|value pairs.<\/div>\n      <\/div>\n<\/fieldset>\n<\/div>\n<input class=\"use-ajax-submit button js-form-submit form-submit\" data-drupal-selector=\"edit-options-group-button-button\" formnovalidate=\"formnovalidate\" type=\"submit\" id=\"edit-options-group-button-button\" name=\"op\" value=\"Single filter\" \/>\n<\/div>\n<div class=\"views-left-40\">\n  <div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-optional form-item-options-group-info-optional\">\n        <input data-drupal-selector=\"edit-options-group-info-optional\" aria-describedby=\"edit-options-group-info-optional--description\" type=\"checkbox\" id=\"edit-options-group-info-optional\" name=\"options[group_info][optional]\" value=\"1\" checked=\"checked\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-optional\" class=\"option\">Optional<\/label>\n          <div id=\"edit-options-group-info-optional--description\" class=\"description\">\n      This exposed filter is optional and will have added options to allow it not to be set.\n    <\/div>\n  <\/div>\n\n  <div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-remember form-item-options-group-info-remember\">\n        <input data-drupal-selector=\"edit-options-group-info-remember\" aria-describedby=\"edit-options-group-info-remember--description\" type=\"checkbox\" id=\"edit-options-group-info-remember\" name=\"options[group_info][remember]\" value=\"1\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-remember\" class=\"option\">Remember<\/label>\n          <div id=\"edit-options-group-info-remember--description\" class=\"description\">\n      Remember the last setting the user gave this filter.\n    <\/div>\n  <\/div>\n\n<\/div>\n<div class=\"views-right-60\">\n  <fieldset data-drupal-selector=\"edit-options-group-info-widget\" aria-describedby=\"edit-options-group-info-widget--wrapper--description\" id=\"edit-options-group-info-widget--wrapper\" class=\"fieldgroup form-composite js-form-item form-item js-form-wrapper form-wrapper\">\n      <legend>\n    <span class=\"fieldset-legend\">Widget type<\/span>\n  <\/legend>\n  <div class=\"fieldset-wrapper\">\n            <div id=\"edit-options-group-info-widget\" class=\"form-radios\"><div class=\"js-form-item form-item js-form-type-radio form-type-radio js-form-item-options-group-info-widget form-item-options-group-info-widget\">\n        <input data-drupal-selector=\"edit-options-group-info-widget-radios\" aria-describedby=\"edit-options-group-info-widget--description\" type=\"radio\" id=\"edit-options-group-info-widget-radios\" name=\"options[group_info][widget]\" value=\"radios\" class=\"form-radio\" \/>\n\n        <label for=\"edit-options-group-info-widget-radios\" class=\"option\">Radios<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-radio form-type-radio js-form-item-options-group-info-widget form-item-options-group-info-widget\">\n        <input data-drupal-selector=\"edit-options-group-info-widget-select\" aria-describedby=\"edit-options-group-info-widget--description\" type=\"radio\" id=\"edit-options-group-info-widget-select\" name=\"options[group_info][widget]\" value=\"select\" checked=\"checked\" class=\"form-radio\" \/>\n\n        <label for=\"edit-options-group-info-widget-select\" class=\"option\">Select<\/label>\n      <\/div>\n<\/div>\n\n              <div id=\"edit-options-group-info-widget--wrapper--description\" class=\"description\">Select which kind of widget will be used to render the group of filters<\/div>\n      <\/div>\n<\/fieldset>\n\n  <div class=\"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-options-group-info-label form-item-options-group-info-label\">\n      <label for=\"edit-options-group-info-label\">Label<\/label>\n        <input data-drupal-selector=\"edit-options-group-info-label\" type=\"text\" id=\"edit-options-group-info-label\" name=\"options[group_info][label]\" value=\"Type\" size=\"40\" maxlength=\"128\" class=\"form-text\" \/>\n\n        <\/div>\n\n  <div class=\"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-options-group-info-description form-item-options-group-info-description\">\n      <label for=\"edit-options-group-info-description\">Description<\/label>\n        <input data-drupal-selector=\"edit-options-group-info-description\" type=\"text\" id=\"edit-options-group-info-description\" name=\"options[group_info][description]\" value=\"\" size=\"60\" maxlength=\"128\" class=\"form-text\" \/>\n\n        <\/div>\n\n<\/div>\n<div class=\"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-options-group-info-identifier form-item-options-group-info-identifier\">\n      <label for=\"edit-options-group-info-identifier\">Filter identifier<\/label>\n        <input data-drupal-selector=\"edit-options-group-info-identifier\" aria-describedby=\"edit-options-group-info-identifier--description\" type=\"text\" id=\"edit-options-group-info-identifier\" name=\"options[group_info][identifier]\" value=\"type\" size=\"40\" maxlength=\"128\" class=\"form-text\" \/>\n\n            <div id=\"edit-options-group-info-identifier--description\" class=\"description\">\n      This will appear in the URL after the ? to identify this filter. Cannot be blank.\n    <\/div>\n  <\/div>\n<div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-multiple form-item-options-group-info-multiple\">\n        <input data-drupal-selector=\"edit-options-group-info-multiple\" aria-describedby=\"edit-options-group-info-multiple--description\" type=\"checkbox\" id=\"edit-options-group-info-multiple\" name=\"options[group_info][multiple]\" value=\"1\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-multiple\" class=\"option\">Allow multiple selections<\/label>\n          <div id=\"edit-options-group-info-multiple--description\" class=\"description\">\n      Enable to allow users to select multiple items.\n    <\/div>\n  <\/div>\n<div class=\"clearfix\"><div id=\"edit-options-group-info-default-group\" class=\"form-radios\"><\/div>\n<\/div><div id=\"edit-options-group-info-default-group-multiple\" class=\"form-checkboxes\"><div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-default-group-multiple-all form-item-options-group-info-default-group-multiple-all\">\n        <input class=\"default-checkboxes form-checkbox\" data-drupal-selector=\"edit-options-group-info-default-group-multiple-all\" type=\"checkbox\" id=\"edit-options-group-info-default-group-multiple-all\" name=\"options[group_info][default_group_multiple][All]\" value=\"All\" \/>\n\n        <label for=\"edit-options-group-info-default-group-multiple-all\" class=\"option\">- Any -<\/label>\n      <\/div>\n<\/div>\n<details data-drupal-selector=\"edit-options-admin-label\" id=\"edit-options-admin-label\" class=\"js-form-wrapper form-wrapper\"><summary role=\"button\" aria-controls=\"edit-options-admin-label\" aria-expanded=\"false\" aria-expanded=\"false\">Administrative title<\/summary><div class=\"details-wrapper\">\n    <div class=\"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-options-admin-label form-item-options-admin-label\">\n      <label for=\"edit-options-admin-label--2\">Administrative title<\/label>\n        <input data-drupal-selector=\"edit-options-admin-label\" aria-describedby=\"edit-options-admin-label--2--description\" type=\"text\" id=\"edit-options-admin-label--2\" name=\"options[admin_label]\" value=\"\" size=\"60\" maxlength=\"128\" class=\"form-text\" \/>\n\n            <div id=\"edit-options-admin-label--2--description\" class=\"description\">\n      This title will be displayed on the views edit page instead of the default one. This might be useful if you have the same item twice.\n    <\/div>\n  <\/div>\n<\/div>\n<\/details>\n\n<table class=\"views-filter-groups responsive-enabled\" id=\"views-filter-groups\" data-striping=\"1\">\n  \n  \n      <thead>\n      <tr>\n                            <th>Default<\/th>\n                            <th>Weight<\/th>\n                            <th>Label<\/th>\n                            <th>Operator<\/th>\n                            <th>Value<\/th>\n                            <th>Operations<\/th>\n              <\/tr>\n    <\/thead>\n  \n      <tbody>\n                      <tr class=\"odd\">\n                      <td><div class=\"js-form-item form-item js-form-type-radio form-type-radio js-form-item-options-group-info-default-group form-item-options-group-info-default-group\">\n        <input class=\"default-radios form-radio\" data-drupal-selector=\"edit-options-group-info-default-group-all\" type=\"radio\" id=\"edit-options-group-info-default-group-all\" name=\"options[group_info][default_group]\" value=\"All\" \/>\n\n        \n      <\/div>\n<\/td>\n                      <td><\/td>\n                      <td colspan=\"4\" class=\"any-default-radios-row\">&lt;Any&gt;<\/td>\n                  <\/tr>\n                      <tr id=\"views-row-2\" class=\"draggable even\">\n                      <td><div class=\"js-form-item form-item js-form-type-radio form-type-radio js-form-item-options-group-info-default-group form-item-options-group-info-default-group\">\n        <input class=\"default-radios form-radio\" data-drupal-selector=\"edit-options-group-info-default-group-2\" type=\"radio\" id=\"edit-options-group-info-default-group-2\" name=\"options[group_info][default_group]\" value=\"2\" \/>\n\n        <label for=\"edit-options-group-info-default-group-2\" class=\"option\">Grouping 2<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-default-group-multiple-2 form-item-options-group-info-default-group-multiple-2\">\n        <input class=\"default-checkboxes form-checkbox\" data-drupal-selector=\"edit-options-group-info-default-group-multiple-2\" type=\"checkbox\" id=\"edit-options-group-info-default-group-multiple-2\" name=\"options[group_info][default_group_multiple][2]\" value=\"2\" \/>\n\n        <label for=\"edit-options-group-info-default-group-multiple-2\" class=\"option\">Grouping 2<\/label>\n      <\/div>\n<\/td>\n                      <td><div class=\"js-form-item form-item js-form-type-select form-type-select js-form-item-options-group-info-group-items-2-weight form-item-options-group-info-group-items-2-weight form-no-label\">\n      <label for=\"edit-options-group-info-group-items-2-weight\" class=\"visually-hidden\">Weight<\/label>\n        <select class=\"weight form-select\" data-drupal-selector=\"edit-options-group-info-group-items-2-weight\" id=\"edit-options-group-info-group-items-2-weight\" name=\"options[group_info][group_items][2][weight]\"><option value=\"-10\">-10<\/option><option value=\"-9\">-9<\/option><option value=\"-8\">-8<\/option><option value=\"-7\">-7<\/option><option value=\"-6\">-6<\/option><option value=\"-5\">-5<\/option><option value=\"-4\">-4<\/option><option value=\"-3\">-3<\/option><option value=\"-2\">-2<\/option><option value=\"-1\">-1<\/option><option value=\"0\" selected=\"selected\">0<\/option><option value=\"1\">1<\/option><option value=\"2\">2<\/option><option value=\"3\">3<\/option><option value=\"4\">4<\/option><option value=\"5\">5<\/option><option value=\"6\">6<\/option><option value=\"7\">7<\/option><option value=\"8\">8<\/option><option value=\"9\">9<\/option><option value=\"10\">10<\/option><\/select>\n        <\/div>\n<\/td>\n                      <td><div class=\"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-options-group-info-group-items-2-title form-item-options-group-info-group-items-2-title form-no-label\">\n      <label for=\"edit-options-group-info-group-items-2-title\" class=\"visually-hidden\">Label<\/label>\n        <input data-drupal-selector=\"edit-options-group-info-group-items-2-title\" type=\"text\" id=\"edit-options-group-info-group-items-2-title\" name=\"options[group_info][group_items][2][title]\" value=\"Article\" size=\"20\" maxlength=\"128\" class=\"form-text\" \/>\n\n        <\/div>\n<\/td>\n                      <td><div class=\"js-form-item form-item js-form-type-select form-type-select js-form-item-options-group-info-group-items-2-operator form-item-options-group-info-group-items-2-operator\">\n      \n        <select data-drupal-selector=\"edit-options-group-info-group-items-2-operator\" id=\"edit-options-group-info-group-items-2-operator\" name=\"options[group_info][group_items][2][operator]\" class=\"form-select\"><option value=\"in\" selected=\"selected\">Is one of<\/option><option value=\"not in\">Is not one of<\/option><\/select>\n        <\/div>\n<\/td>\n                      <td><div id=\"edit-options-value-wrapper\"><fieldset data-drupal-selector=\"edit-options-group-info-group-items-2-value\" id=\"edit-options-group-info-group-items-2-value--wrapper\" class=\"fieldgroup form-composite js-form-item form-item js-form-wrapper form-wrapper\" data-drupal-states=\"{&quot;visible&quot;:[{&quot;:input[name=\\u0022options[group_info][group_items][2][operator]\\u0022]&quot;:{&quot;value&quot;:&quot;in&quot;}},{&quot;:input[name=\\u0022options[group_info][group_items][2][operator]\\u0022]&quot;:{&quot;value&quot;:&quot;not in&quot;}}]}\">\n      <legend>\n    <span class=\"fieldset-legend\"><\/span>\n  <\/legend>\n  <div class=\"fieldset-wrapper\">\n            <div id=\"edit-options-group-info-group-items-2-value\" class=\"form-checkboxes\"><div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-2-value-all form-item-options-group-info-group-items-2-value-all\">\n        <input data-drupal-selector=\"edit-options-group-info-group-items-2-value-all\" type=\"checkbox\" id=\"edit-options-group-info-group-items-2-value-all\" name=\"options[group_info][group_items][2][value][all]\" value=\"all\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-group-items-2-value-all\" class=\"option\">Select all<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-2-value-article form-item-options-group-info-group-items-2-value-article\">\n        <input data-drupal-selector=\"edit-options-group-info-group-items-2-value-article\" type=\"checkbox\" id=\"edit-options-group-info-group-items-2-value-article\" name=\"options[group_info][group_items][2][value][article]\" value=\"article\" checked=\"checked\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-group-items-2-value-article\" class=\"option\">Article<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-2-value-page form-item-options-group-info-group-items-2-value-page\">\n        <input data-drupal-selector=\"edit-options-group-info-group-items-2-value-page\" type=\"checkbox\" id=\"edit-options-group-info-group-items-2-value-page\" name=\"options[group_info][group_items][2][value][page]\" value=\"page\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-group-items-2-value-page\" class=\"option\">Basic page<\/label>\n      <\/div>\n<\/div>\n\n          <\/div>\n<\/fieldset>\n<\/div><\/td>\n                      <td><a href=\"\" id=\"views-remove-link-2\" class=\"views-hidden views-button-remove views-groups-remove-link views-remove-link\" alt=\"Remove this item\" title=\"Remove this item\"><span>Remove<\/span><\/a><div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-2-remove form-item-options-group-info-group-items-2-remove form-no-label\">\n        <input class=\"views-remove-checkbox form-checkbox\" data-drupal-selector=\"views-removed-2\" type=\"checkbox\" id=\"views-removed-2\" name=\"options[group_info][group_items][2][remove]\" value=\"1\" \/>\n\n        <\/div>\n<\/td>\n                  <\/tr>\n                      <tr id=\"views-row-3\" class=\"draggable odd\">\n                      <td><div class=\"js-form-item form-item js-form-type-radio form-type-radio js-form-item-options-group-info-default-group form-item-options-group-info-default-group\">\n        <input class=\"default-radios form-radio\" data-drupal-selector=\"edit-options-group-info-default-group-3\" type=\"radio\" id=\"edit-options-group-info-default-group-3\" name=\"options[group_info][default_group]\" value=\"3\" \/>\n\n        <label for=\"edit-options-group-info-default-group-3\" class=\"option\">Grouping 3<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-default-group-multiple-3 form-item-options-group-info-default-group-multiple-3\">\n        <input class=\"default-checkboxes form-checkbox\" data-drupal-selector=\"edit-options-group-info-default-group-multiple-3\" type=\"checkbox\" id=\"edit-options-group-info-default-group-multiple-3\" name=\"options[group_info][default_group_multiple][3]\" value=\"3\" \/>\n\n        <label for=\"edit-options-group-info-default-group-multiple-3\" class=\"option\">Grouping 3<\/label>\n      <\/div>\n<\/td>\n                      <td><div class=\"js-form-item form-item js-form-type-select form-type-select js-form-item-options-group-info-group-items-3-weight form-item-options-group-info-group-items-3-weight form-no-label\">\n      <label for=\"edit-options-group-info-group-items-3-weight\" class=\"visually-hidden\">Weight<\/label>\n        <select class=\"weight form-select\" data-drupal-selector=\"edit-options-group-info-group-items-3-weight\" id=\"edit-options-group-info-group-items-3-weight\" name=\"options[group_info][group_items][3][weight]\"><option value=\"-10\">-10<\/option><option value=\"-9\">-9<\/option><option value=\"-8\">-8<\/option><option value=\"-7\">-7<\/option><option value=\"-6\">-6<\/option><option value=\"-5\">-5<\/option><option value=\"-4\">-4<\/option><option value=\"-3\">-3<\/option><option value=\"-2\">-2<\/option><option value=\"-1\">-1<\/option><option value=\"0\">0<\/option><option value=\"1\" selected=\"selected\">1<\/option><option value=\"2\">2<\/option><option value=\"3\">3<\/option><option value=\"4\">4<\/option><option value=\"5\">5<\/option><option value=\"6\">6<\/option><option value=\"7\">7<\/option><option value=\"8\">8<\/option><option value=\"9\">9<\/option><option value=\"10\">10<\/option><\/select>\n        <\/div>\n<\/td>\n                      <td><div class=\"js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-options-group-info-group-items-3-title form-item-options-group-info-group-items-3-title form-no-label\">\n      <label for=\"edit-options-group-info-group-items-3-title\" class=\"visually-hidden\">Label<\/label>\n        <input data-drupal-selector=\"edit-options-group-info-group-items-3-title\" type=\"text\" id=\"edit-options-group-info-group-items-3-title\" name=\"options[group_info][group_items][3][title]\" value=\"Page\" size=\"20\" maxlength=\"128\" class=\"form-text\" \/>\n\n        <\/div>\n<\/td>\n                      <td><div class=\"js-form-item form-item js-form-type-select form-type-select js-form-item-options-group-info-group-items-3-operator form-item-options-group-info-group-items-3-operator\">\n      \n        <select data-drupal-selector=\"edit-options-group-info-group-items-3-operator\" id=\"edit-options-group-info-group-items-3-operator\" name=\"options[group_info][group_items][3][operator]\" class=\"form-select\"><option value=\"in\" selected=\"selected\">Is one of<\/option><option value=\"not in\">Is not one of<\/option><\/select>\n        <\/div>\n<\/td>\n                      <td><div id=\"edit-options-value-wrapper\"><fieldset data-drupal-selector=\"edit-options-group-info-group-items-3-value\" id=\"edit-options-group-info-group-items-3-value--wrapper\" class=\"fieldgroup form-composite js-form-item form-item js-form-wrapper form-wrapper\" data-drupal-states=\"{&quot;visible&quot;:[{&quot;:input[name=\\u0022options[group_info][group_items][3][operator]\\u0022]&quot;:{&quot;value&quot;:&quot;in&quot;}},{&quot;:input[name=\\u0022options[group_info][group_items][3][operator]\\u0022]&quot;:{&quot;value&quot;:&quot;not in&quot;}}]}\">\n      <legend>\n    <span class=\"fieldset-legend\"><\/span>\n  <\/legend>\n  <div class=\"fieldset-wrapper\">\n            <div id=\"edit-options-group-info-group-items-3-value\" class=\"form-checkboxes\"><div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-3-value-all form-item-options-group-info-group-items-3-value-all\">\n        <input data-drupal-selector=\"edit-options-group-info-group-items-3-value-all\" type=\"checkbox\" id=\"edit-options-group-info-group-items-3-value-all\" name=\"options[group_info][group_items][3][value][all]\" value=\"all\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-group-items-3-value-all\" class=\"option\">Select all<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-3-value-article form-item-options-group-info-group-items-3-value-article\">\n        <input data-drupal-selector=\"edit-options-group-info-group-items-3-value-article\" type=\"checkbox\" id=\"edit-options-group-info-group-items-3-value-article\" name=\"options[group_info][group_items][3][value][article]\" value=\"article\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-group-items-3-value-article\" class=\"option\">Article<\/label>\n      <\/div>\n<div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-3-value-page form-item-options-group-info-group-items-3-value-page\">\n        <input data-drupal-selector=\"edit-options-group-info-group-items-3-value-page\" type=\"checkbox\" id=\"edit-options-group-info-group-items-3-value-page\" name=\"options[group_info][group_items][3][value][page]\" value=\"page\" checked=\"checked\" class=\"form-checkbox\" \/>\n\n        <label for=\"edit-options-group-info-group-items-3-value-page\" class=\"option\">Basic page<\/label>\n      <\/div>\n<\/div>\n\n          <\/div>\n<\/fieldset>\n<\/div><\/td>\n                      <td><a href=\"\" id=\"views-remove-link-3\" class=\"views-hidden views-button-remove views-groups-remove-link views-remove-link\" alt=\"Remove this item\" title=\"Remove this item\"><span>Remove<\/span><\/a><div class=\"js-form-item form-item js-form-type-checkbox form-type-checkbox js-form-item-options-group-info-group-items-3-remove form-item-options-group-info-group-items-3-remove form-no-label\">\n        <input class=\"views-remove-checkbox form-checkbox\" data-drupal-selector=\"views-removed-3\" type=\"checkbox\" id=\"views-removed-3\" name=\"options[group_info][group_items][3][remove]\" value=\"1\" \/>\n\n        <\/div>\n<\/td>\n                  <\/tr>\n          <\/tbody>\n    <\/table>\n\n<div class=\"views-build-group clear-block\"><input class=\"use-ajax-submit button js-form-submit form-submit\" data-drupal-selector=\"edit-options-group-info-add-group\" type=\"submit\" id=\"edit-options-group-info-add-group\" name=\"op\" value=\"Add another item\" \/>\n<\/div>\n\n<\/div>\n<input data-drupal-selector=\"form-jqeh42lozdfu-4-wircfde5bdvoc-u4kxdawcj5p-ry\" type=\"hidden\" name=\"form_build_id\" value=\"form-JQEH42lOzDfu-4_wiRCfde5BDvoC-u4KxDawcJ5P_RY\" \/>\n<input data-drupal-selector=\"edit-views-ui-config-item-form-form-token\" type=\"hidden\" name=\"form_token\" value=\"SuW2b8DSCj2_r6nbwvcssFeKNDmojZsosUWoXyyhvvw\" \/>\n<input data-drupal-selector=\"edit-views-ui-config-item-form\" type=\"hidden\" name=\"form_id\" value=\"views_ui_config_item_form\" \/>\n<div data-drupal-selector=\"edit-actions\" class=\"form-actions js-form-wrapper form-wrapper\" id=\"edit-actions\"><input data-drupal-selector=\"edit-submit-views-ui-config-item-form\" type=\"submit\" id=\"edit-submit-views-ui-config-item-form\" name=\"op\" value=\"Apply\" class=\"button button--primary js-form-submit form-submit\" \/>\n<input data-drupal-selector=\"edit-cancel\" formnovalidate=\"formnovalidate\" type=\"submit\" id=\"edit-cancel\" name=\"op\" value=\"Cancel\" class=\"button js-form-submit form-submit\" \/>\n<input data-drupal-selector=\"edit-remove\" formnovalidate=\"formnovalidate\" type=\"submit\" id=\"edit-remove\" name=\"op\" value=\"Remove\" class=\"button button--danger js-form-submit form-submit\" \/>\n<\/div>\n\n<\/form>\n",
    "dialogOptions": {
      "dialogClass": "views-ui-dialog",
      "width": "75%",
      "modal": true,
      "title": "Configure filter criterion: Content: Type"
    }
  },
  {
    "command": "viewsHighlight",
    "selector": ".page-1-filter-type"
  }
]

Hope this helps!

Anonymous’s picture

Issue tags: +VDC

After locally trying to reproduce this, I found the actual error in my php-fpm logs:

WARNING: [pool www] child 9 said into stderr: "NOTICE: PHP message: Uncaught PHP Exception InvalidArgumentException: "The configuration property display.default.display_options.filters.type.group_info.group_items.1.value.all doesn't exist." at /var/www/html/core/lib/Drupal/Core/Config/Schema/ArrayElement.php line 79"

After removing the "select all" option, I get a similar error:

WARNING: [pool www] child 8 said into stderr: "NOTICE: PHP message: Uncaught PHP Exception InvalidArgumentException: "The configuration property display.default.display_options.filters.type.group_info.group_items.1.value.article doesn't exist." at /var/www/html/core/lib/Drupal/Core/Config/Schema/ArrayElement.php line 79"

This basically means that Drupal is unable to store the grouped filter values, because it doesn't know how to do so. I'm not sure whether the key is wrong or if it simply doesn't exist.
Tagging so it hopefully gets on the radar of the views people.

Lendude’s picture

Status: Needs work » Needs review
FileSize
2.1 KB

The problem seems to be that an array gets written to a field set to take a string value. That doesn't work. The other way around doesn't appear to be a problem though.

Manually tested this with a filter trying to set an array value (Node type) and a filter trying to set a string value (Node title), both worked manually. Lets see what the testbot thinks.

dawehner’s picture

Its so nice that we have a test already!

Lendude’s picture

Yeah, such luxury! But it does expose a follow-up issue, namely that you can apply the settings without actually selecting any checkboxes. The validation function feels that an array where all (or any actually) the values are 0 is a valid value.

But that's a different issue.

Status: Needs review » Needs work

The last submitted patch, 8: views_grouped_filter-2595027-8.patch, failed testing.

mradcliffe’s picture

+++ b/core/modules/views/config/schema/views.data_types.schema.yml
@@ -777,8 +777,11 @@ views_filter_group_item:
-      type: label
-      label: 'Value'
+      type: sequence
+      label: 'Values'
+      sequence:
+        type: string
+        label: 'Value'

The test fails exposed this, but this is a data model change, right? Does that mean it needs an update hook and all of the views configuration need to be changed?

Lendude’s picture

@mradcliffe If this is the route we want to take to fixing this issue, then yeah I guess we need those things. No idea how to go about that though.

Tried to get the patch in the green by updating the config files currently in core but some of them don't want to play nice. Also, when I export a view config using config manager it seems to be using the old data model.

claudiu.cristea’s picture

@dawehner, the "only test" patch was here since #0.

Lendude’s picture

Status: Needs work » Closed (duplicate)

Closing this as a duplicate of #2369119: Fatal error when trying to save a View with grouped filters using other than string values, fix there looks better. Moved the test from #0 to that issue.

claudiu.cristea’s picture

Status: Closed (duplicate) » Needs work

Hey, it's not about "looking better". This was the first report, this needs to stay and the other one is duplicate. If you feel that the other one is duplicating this, close that. Thank you

Lendude’s picture

Uhh in what date system is November 4, 2014 - 22:28 after October 16, 2015 - 19:27 ..... the other issue is almost a year older then this.

And it's all about fixing the issue not about who was first, so lets work on the patch that has done the most to fix the issue .... that's not this patch, but whatever.

claudiu.cristea’s picture

Status: Needs work » Closed (duplicate)

@Lendude, ouch sorry. I didn't noticed the year :)

Lendude’s picture

@claudiu.cristea no worries :-)

Just good to have all our efforts to fix this in one place, I don't really care where that is.