Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #3
Balu Ertl