An error is appearing every time I save the form on the processors tab: /web/admin/config/search/search-api/index/content_index/processors

It only happens when "Enable on all supported fields" is selected, for example with ignore case processor.

Edit: and when there are no fields being indexed as "fulltext" so no fields are available to select in the processor settings.

    Notice: Undefined index: #options in Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm() (line 271 of modules/contrib/search_api/src/Processor/FieldsProcessorPluginBase.php).

    Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm(Array, Object) (Line: 276)
    Drupal\search_api\Form\IndexProcessorsForm->validateForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 83)
    Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 270)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'search_api_index_processors_form') (Line: 119)
    Drupal\Core\Form\FormValidator->validateForm('search_api_index_processors_form', Array, Object) (Line: 571)
    Drupal\Core\Form\FormBuilder->processForm('search_api_index_processors_form', Array, Object) (Line: 314)
    Drupal\Core\Form\FormBuilder->buildForm(Object, 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)

    Warning: array_keys() expects parameter 1 to be array, null given in Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm() (line 271 of modules/contrib/search_api/src/Processor/FieldsProcessorPluginBase.php).

    Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm(Array, Object) (Line: 276)
    Drupal\search_api\Form\IndexProcessorsForm->validateForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 83)
    Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 270)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'search_api_index_processors_form') (Line: 119)
    Drupal\Core\Form\FormValidator->validateForm('search_api_index_processors_form', Array, Object) (Line: 571)
    Drupal\Core\Form\FormBuilder->processForm('search_api_index_processors_form', Array, Object) (Line: 314)
    Drupal\Core\Form\FormBuilder->buildForm(Object, 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)

    Notice: Undefined index: #options in Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm() (line 271 of modules/contrib/search_api/src/Processor/FieldsProcessorPluginBase.php).

    Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm(Array, Object) (Line: 97)
    Drupal\search_api\Plugin\search_api\processor\IgnoreCharacters->validateConfigurationForm(Array, Object) (Line: 276)
    Drupal\search_api\Form\IndexProcessorsForm->validateForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 83)
    Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 270)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'search_api_index_processors_form') (Line: 119)
    Drupal\Core\Form\FormValidator->validateForm('search_api_index_processors_form', Array, Object) (Line: 571)
    Drupal\Core\Form\FormBuilder->processForm('search_api_index_processors_form', Array, Object) (Line: 314)
    Drupal\Core\Form\FormBuilder->buildForm(Object, 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)

    Warning: array_keys() expects parameter 1 to be array, null given in Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm() (line 271 of modules/contrib/search_api/src/Processor/FieldsProcessorPluginBase.php).

    Drupal\search_api\Processor\FieldsProcessorPluginBase->validateConfigurationForm(Array, Object) (Line: 97)
    Drupal\search_api\Plugin\search_api\processor\IgnoreCharacters->validateConfigurationForm(Array, Object) (Line: 276)
    Drupal\search_api\Form\IndexProcessorsForm->validateForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 83)
    Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 270)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'search_api_index_processors_form') (Line: 119)
    Drupal\Core\Form\FormValidator->validateForm('search_api_index_processors_form', Array, Object) (Line: 571)
    Drupal\Core\Form\FormBuilder->processForm('search_api_index_processors_form', Array, Object) (Line: 314)
    Drupal\Core\Form\FormBuilder->buildForm(Object, 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)

Comments

mchelen created an issue. See original summary.

mchelen’s picture

Issue occurs when there are no fields being indexed as "fulltext" and so nothing is available to select in the processor settings.

mchelen’s picture

Title: Error: "Undefined index: #options" when "Enable on all supported fields" selected in processors » Error: "Undefined index: #options" in Processor settings when no fields are selectable
Issue summary: View changes
drunken monkey’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Component: General code » User interface
Status: Active » Needs review
StatusFileSize
new529 bytes

You're right, thanks a lot for reporting! It's not even just broken if there are no fields to select – it's broken in general. I don't think this ever worked. Apparently, no-one really tested this (with error reporting turned on) before we committed it.
Anyways, it's very easy to fix: see (and please test) the attached patch.

Also, since we also write that information when the index is saved, I don't think this really had any effect, other than the notice.

maaty388’s picture

Status: Needs review » Reviewed & tested by the community

Thank you, "error" is gone.

  • drunken monkey committed e42d9c9 on 8.x-1.x
    Issue #2903014 by drunken monkey: Fixed "Enable for all fields"...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Good to hear, thanks a lot for testing!
Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.