Empty form submission causes exception:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\config_partial_export\Form\ConfigPartialExportForm::createArchive() must be of the type array, null given, called in /Users/baluertl/Repos/config_partial_export/src/Form/ConfigPartialExportForm.php on line 158 in Drupal\config_partial_export\Form\ConfigPartialExportForm->createArchive() (line 173 of /Users/baluertl/Repos/config_partial_export/src/Form/ConfigPartialExportForm.php).
Drupal\config_partial_export\Form\ConfigPartialExportForm->createArchive(NULL, NULL) (Line: 158)
Drupal\config_partial_export\Form\ConfigPartialExportForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 590)
Drupal\Core\Form\FormBuilder->processForm('config_partial_export_form', Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
…

This is because invocation of createArchive() method is not prepared once the 'change_list' key is NULL.

Also, the validateForm method checks only the majority of the form (the values from the #tableselect list), but ignores value of the "system.site info" checkbox. We can extend its assessment scope.

Comments

Balu Ertl created an issue. See original summary.

  • Balu Ertl committed b36f84f on 8.x-1.x
    Issue #3096354 by Balu Ertl: Empty form submission causes exception
    
Balu Ertl’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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