Commit 7ed24a5a authored by catch's avatar catch

Issue #2728507 by Lendude, Kristen Pol, pameeela: Not selecting an entity type...

Issue #2728507 by Lendude, Kristen Pol, pameeela: Not selecting an entity type on Config import single leads to a fatal error

(cherry picked from commit c976dbbf)
parent 1b823bcd
......@@ -317,7 +317,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
}
// Validate for config entities.
if ($form_state->getValue('config_type') !== 'system.simple') {
if ($form_state->getValue('config_type') && $form_state->getValue('config_type') !== 'system.simple') {
$definition = $this->entityTypeManager->getDefinition($form_state->getValue('config_type'));
$id_key = $definition->getKey('id');
......
......@@ -231,6 +231,10 @@ public function testImportSimpleConfiguration() {
$this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import'));
$this->assertText(t('Can not uninstall the Configuration module as part of a configuration synchronization through the user interface.'));
// Try to import without any values.
$this->drupalPostForm('admin/config/development/configuration/single/import', [], t('Import'));
$this->assertText('Configuration type field is required.');
$this->assertText('Paste your configuration here field is required.');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment