From dc4d1246a99199b0713c80fe3c7af402e19b7a79 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 7 Apr 2015 15:05:57 +0200 Subject: [PATCH] Fix that the sql port does not change when updating the type of the database fixes #7491 --- application/forms/Config/Resource/DbResourceForm.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/application/forms/Config/Resource/DbResourceForm.php b/application/forms/Config/Resource/DbResourceForm.php index 7bf0cb8ff..0ee64eda3 100644 --- a/application/forms/Config/Resource/DbResourceForm.php +++ b/application/forms/Config/Resource/DbResourceForm.php @@ -49,6 +49,7 @@ class DbResourceForm extends Form 'db', array( 'required' => true, + 'autosubmit' => true, 'label' => $this->translate('Database Type'), 'description' => $this->translate('The type of SQL database'), 'multiOptions' => $dbChoices @@ -68,10 +69,11 @@ class DbResourceForm extends Form 'number', 'port', array( - 'required' => true, - 'label' => $this->translate('Port'), - 'description' => $this->translate('The port to use'), - 'value' => 3306 + 'required' => true, + 'preserveDefault' => true, + 'label' => $this->translate('Port'), + 'description' => $this->translate('The port to use'), + 'value' => ! array_key_exists('db', $formData) || $formData['db'] === 'mysql' ? 3306 : 5432 ) ); $this->addElement(