Fix that the sql port does not change when updating the type of the database

fixes #7491
This commit is contained in:
Johannes Meyer 2015-04-07 15:05:57 +02:00
parent 9596b4fdf7
commit dc4d1246a9

View File

@ -49,6 +49,7 @@ class DbResourceForm extends Form
'db', 'db',
array( array(
'required' => true, 'required' => true,
'autosubmit' => true,
'label' => $this->translate('Database Type'), 'label' => $this->translate('Database Type'),
'description' => $this->translate('The type of SQL database'), 'description' => $this->translate('The type of SQL database'),
'multiOptions' => $dbChoices 'multiOptions' => $dbChoices
@ -68,10 +69,11 @@ class DbResourceForm extends Form
'number', 'number',
'port', 'port',
array( array(
'required' => true, 'required' => true,
'label' => $this->translate('Port'), 'preserveDefault' => true,
'description' => $this->translate('The port to use'), 'label' => $this->translate('Port'),
'value' => 3306 'description' => $this->translate('The port to use'),
'value' => ! array_key_exists('db', $formData) || $formData['db'] === 'mysql' ? 3306 : 5432
) )
); );
$this->addElement( $this->addElement(