Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295466

Undefined index notice on empty exposed filter text inputs in views

$
0
0

We never check if there is an input index for an exposed filter before we try to fetch it from the array of inputs in FilterPluginBase::acceptExposedInput which can causes notices for empty inputs:
$value = $input[$this->options['expose']['identifier']];

Further down in FilterPluginBase::acceptExposedInput we check if the $value variable is set. But at this point, we've already received a notice.

if (isset($value)) {
  $this->value = $value;
  if (empty($this->alwaysMultiple) && empty($this->options['expose']['multiple']) && !is_array($value)) {
    $this->value = [$value];
  }
}

Stack trace:

Notice: Undefined index: filename in Drupal\views\Plugin\views\filter\FilterPluginBase->acceptExposedInput() (line 1385 of core/modules/views/src/Plugin/views/filter/FilterPluginBase.php).
Drupal\views\Plugin\views\filter\FilterPluginBase->acceptExposedInput(Array) (Line: 1352)
Drupal\views\ViewExecutable->_build('filter') (Line: 1248)
Drupal\views\ViewExecutable->build(NULL) (Line: 1377)
Drupal\views\ViewExecutable->execute(NULL) (Line: 1440)
Drupal\views\ViewExecutable->render() (Line: 33)
Drupal\entity_browser\Plugin\views\display\EntityBrowser->execute() (Line: 1616)
Drupal\views\ViewExecutable->executeDisplay('entity_browser_1') (Line: 118)
Drupal\entity_browser\Plugin\EntityBrowser\Widget\View->getForm(Array, Object, Array) (Line: 127)
Drupal\entity_browser\Form\EntityBrowserForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 514)
Drupal\Core\Form\FormBuilder->retrieveForm('entity_browser_browse_files_modal_form', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm('entity_browser_browse_files_modal_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Viewing all articles
Browse latest Browse all 295466

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>