Skip to content

Commit e4d3b30

Browse files
authored
Fix undefined index error in form. (#947)
1 parent 9fb93b5 commit e4d3b30

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Form/ServerForm.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ public function form(array $form, FormStateInterface $formState) {
8989
$schemas = array_map(function ($definition) {
9090
return $definition['name'] ?? $definition['id'];
9191
}, $this->schemaManager->getDefinitions());
92-
$schema = ($formState->getUserInput()['schema'] ?? $server->get('schema')) ?: reset(array_keys($schemas));
92+
93+
$input = $formState->getUserInput();
94+
$inputSchema = array_key_exists('schema', $input) ? $input['schema'] : NULL;
95+
$schema = ($formSchema ?? $server->get('schema')) ?: reset(array_keys($schemas));
9396

9497
if ($this->operation == 'add') {
9598
$form['#title'] = $this->t('Add server');

0 commit comments

Comments
 (0)