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;
|
||||
|
||||
use Icinga\Forms\ConfigForm;
|
||||
use LogicException;
|
||||
use InvalidArgumentException;
|
||||
use Icinga\Web\Session\SessionNamespace;
|
||||
|
@ -286,7 +287,7 @@ class Wizard
|
|||
|
||||
if ($isValid) {
|
||||
$pageData = & $this->getPageData();
|
||||
$pageData[$page->getName()] = $page->getValues();
|
||||
$pageData[$page->getName()] = ConfigForm::transformEmptyValuesToNull($page->getValues());
|
||||
$this->setCurrentPage($this->getNewPage($requestedPage, $page));
|
||||
$page->getResponse()->redirectAndExit($page->getRedirectUrl());
|
||||
}
|
||||
|
|
|
@ -121,6 +121,12 @@ class DbTool
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue