TypeError: Argument 1 passed to Drupal\Core\Form\FormState::setUserInput() must be of the type array, null given

Created on 15 February 2019, almost 6 years ago
Updated 16 April 2024, 7 months ago

Hi, I getting the following PHP error after updating to alpha 5. This is only the first few lines of the error message, I'm happy to provide more if it's useful. The are some other Type messages about undefined variables as well, I'll post the first few lines of one of those too. There was a Notice about an undefined index but I installed the patch at /project/better_exposed_filters/issues/3012046, which fixed that one message.

TypeError: Argument 1 passed to Drupal\Core\Form\FormState::setUserInput() must be of the type array, null given, called in /app/web/core/modules/views/src/Plugin/views/filter/Date.php on line 255 in Drupal\Core\Form\FormState->setUserInput() (line 971 of /app/web/core/lib/Drupal/Core/Form/FormState.php) #0 /app/web/core/modules/views/src/Plugin/views/filter/Date.php(255): Drupal\Core\Form\FormState->setUserInput(NULL) #1 /app/web/core/modules/datetime/src/Plugin/views/filter/Date.php(203): Drupal\views\Plugin\views\filter\Date->buildExposedForm(Array, Object(Drupal\Core\Form\FormState)) #2 /app/web/modules/contrib/better_exposed_filters/src/Plugin/views/exposed_form/BetterExposedFilters.php(529): Drupal\datetime\Plugin\views\filter\Date->buildExposedForm(Array, Object(Drupal\Core\Form\FormState)) #3 /app/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(1804): Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState)) #4 /app/web/core/modules/views_ui/src/Form/Ajax/Display.php(74): Drupal\views\Plugin\views\display\DisplayPluginBase->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState)) #5 [internal function]: Drupal\views_ui\Form\Ajax\Display->buildForm(Array, Object(Drupal\Core\Form\FormState)) #6 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(518): call_user_func_array(Array, Array)

Notice: Undefined variable: source in Drupal\views\Plugin\views\filter\NumericFilter->valueForm() (line 286 of /app/web/core/modules/views/src/Plugin/views/filter/NumericFilter.php) #0 /app/web/core/includes/bootstrap.inc(584): _drupal_error_handler_real(8, 'Undefined varia...', '/app/web/core/m...', 286, Array) #1 /app/web/core/modules/views/src/Plugin/views/filter/NumericFilter.php(286): _drupal_error_handler(8, 'Undefined varia...', '/app/web/core/m...', 286, Array) #2 /app/web/core/modules/views/src/Plugin/views/filter/Date.php(55): Drupal\views\Plugin\views\filter\NumericFilter->valueForm(Array, Object(Drupal\Core\Form\FormState)) #3 /app/web/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php(861): Drupal\views\Plugin\views\filter\Date->valueForm(Array, Object(Drupal\Core\Form\FormState)) #4 /app/web/core/modules/views/src/Plugin/views/filter/Date.php(214): Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedForm(Array, Object(Drupal\Core\Form\FormState)) #5 /app/web/core/modules/datetime/src/Plugin/views/filter/Date.php(203): Drupal\views\Plugin\views\filter\Date->buildExposedForm(Array, Object(Drupal\Core\Form\FormState)) #6 /app/web/modules/contrib/better_exposed_filters/src/Plugin/views/exposed_form/BetterExposedFilters.php(529): Drupal\datetime\Plugin\views\filter\Date->buildExposedForm(Array, Object(Drupal\Core\Form\FormState))

πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rick_p

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡­πŸ‡ΊHungary gdeni

    This is still a bug in 6.0.3, passing an empty array instead of NULL fixes it. Patch attached.

  • πŸ‡§πŸ‡ͺBelgium aurelievndl_e1

    I'm confirming that the patch #7 seems alright with the version 6.0.3. it applied successfully to 10.2.x. The type error occurred when clicking the Better Exposed Filters Settings of a view.

Production build 0.71.5 2024