Require a port only for postgres connections

Screw it!

refs #9683
This commit is contained in:
Eric Lippmann 2015-09-07 17:01:09 +02:00
parent e45140dd86
commit 65e4d23d89
1 changed files with 4 additions and 2 deletions

View File

@ -78,9 +78,11 @@ class DbResourceForm extends Form
'number',
'port',
array(
'preserveDefault' => true,
'description' => $this->translate('The port to use'),
'label' => $this->translate('Port'),
'description' => $this->translate('The port to use')
'preserveDefault' => true,
'required' => isset($formData['db']) && $formData['db'] === 'pgsql',
'value' => isset($formData['db']) && $formData['db'] === 'pgsql' ? 5432 : null
)
);
$this->addElement(