Commit a895fa2d authored by BR0kEN's avatar BR0kEN Committed by Rick Hawkins
Browse files

Issue #2978949 by BR0kEN, afi13: Notice: Undefined index: exposed in...

Issue #2978949 by BR0kEN, afi13: Notice: Undefined index: exposed in Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters->exposedFormAlter()
parent cbe7f88e
......@@ -116,8 +116,9 @@ class BetterExposedFilters extends InputRequired {
* Add options for exposed sorts.
*/
$exposed = FALSE;
/* @var \Drupal\views\Plugin\views\HandlerBase $sort */
foreach ($this->view->display_handler->getHandlers('sort') as $label => $sort) {
if ($sort->options['exposed']) {
if ($sort->isExposed()) {
$exposed = TRUE;
break;
}
......@@ -254,8 +255,9 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
$bef_filter_intro = FALSE;
// Go through each filter and add BEF options.
/* @var \Drupal\views\Plugin\views\HandlerBase $filter */
foreach ($this->view->display_handler->getHandlers('filter') as $label => $filter) {
if (!$filter->options['exposed']) {
if (!$filter->isExposed()) {
continue;
}
......@@ -873,13 +875,14 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
}
// Shorthand for all filters in this view.
/* @var \Drupal\views\Plugin\views\HandlerBase[] $filters */
$filters = $form_state->get('view')->display_handler->handlers['filter'];
// Go through each saved option looking for Better Exposed Filter settings.
foreach ($settings as $label => $options) {
// Sanity check: Ensure this filter is an exposed filter.
if (empty($filters[$label]) || !$filters[$label]->options['exposed']) {
if (empty($filters[$label]) || !$filters[$label]->isExposed()) {
continue;
}
......@@ -1581,8 +1584,9 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
);
// Go through each exposed filter and collect settings.
/* @var \Drupal\views\Plugin\views\HandlerBase $filter */
foreach ($this->view->display_handler->getHandlers('filter') as $label => $filter) {
if (!$filter->options['exposed']) {
if (!$filter->isExposed()) {
continue;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment