Using a form_alter
to change the display of an exposed form element to a checkbox results in no results until an option has been selected. (This is different behavior that the default multi-select element).
Steps to reproduce:
- Clean install of D8 with dummy content (requires devel) (drush si standard -y --account-pass=admin && drush dl devel && drush en devel_generate -y && drush generate-content 50)
- Navigate to /admin/structure/views/view/content
- Click the "Content: Type" filter to edit it, tick "Allow multiple selections" and press Apply and Save the view.
- Add the following to core/themes/seven/seven.theme
(you may need to clear the cache after this)function seven_form_views_exposed_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) { $form['type']['#type'] = 'checkboxes'; }
- Navigate to /admin/content
No results are displayed. If you tick one of the checkboxes, the view works as expected.