mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-22 13:24:24 +02:00
Wizard: Transform emtpy page data values to null
Previously the wizard wrote empty strings to config files.
This commit is contained in:
parent
8b7a3f05af
commit
53c0d6de86
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Web;
|
namespace Icinga\Web;
|
||||||
|
|
||||||
|
use Icinga\Forms\ConfigForm;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Icinga\Web\Session\SessionNamespace;
|
use Icinga\Web\Session\SessionNamespace;
|
||||||
@ -286,7 +287,7 @@ class Wizard
|
|||||||
|
|
||||||
if ($isValid) {
|
if ($isValid) {
|
||||||
$pageData = & $this->getPageData();
|
$pageData = & $this->getPageData();
|
||||||
$pageData[$page->getName()] = $page->getValues();
|
$pageData[$page->getName()] = ConfigForm::transformEmptyValuesToNull($page->getValues());
|
||||||
$this->setCurrentPage($this->getNewPage($requestedPage, $page));
|
$this->setCurrentPage($this->getNewPage($requestedPage, $page));
|
||||||
$page->getResponse()->redirectAndExit($page->getRedirectUrl());
|
$page->getResponse()->redirectAndExit($page->getRedirectUrl());
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,12 @@ class DbTool
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $config)
|
public function __construct(array $config)
|
||||||
{
|
{
|
||||||
|
if (! isset($config['port'])) {
|
||||||
|
// TODO: This is not quite correct, but works as it previously did. Previously empty values were not
|
||||||
|
// transformed no NULL (now they are) so if the port is now null, it's been the empty string.
|
||||||
|
$config['port'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user