RestoreBasketForm: do not fail with a single DB

fixes #1716
This commit is contained in:
Thomas Gelf 2018-12-11 00:26:01 +01:00
parent 89e8bec380
commit 788fb452cd
2 changed files with 17 additions and 9 deletions

View File

@ -47,15 +47,13 @@ class RestoreBasketForm extends QuickForm
public function setup()
{
$allowedDbs = $this->listAllowedDbResourceNames();
if (count($allowedDbs) > 1) {
$this->addElement('select', 'target_db', [
'label' => $this->translate('Target DB'),
'description' => $this->translate('Restore to this target Director DB'),
'multiOptions' => $allowedDbs,
'value' => $this->getRequest()->getParam('target_db', $this->getFirstDbResourceName()),
'class' => 'autosubmit',
]);
}
$this->addElement('select', 'target_db', [
'label' => $this->translate('Target DB'),
'description' => $this->translate('Restore to this target Director DB'),
'multiOptions' => $allowedDbs,
'value' => $this->getRequest()->getParam('target_db', $this->getFirstDbResourceName()),
'class' => 'autosubmit',
]);
$this->setSubmitLabel($this->translate('Restore'));
}

View File

@ -4,6 +4,16 @@
Please make sure to always read our [Upgrading](05-Upgrading.md) documentation
before switching to a new version.
1.6.1 (unreleased)
------------------
### Fixed issues
* You can find issues and feature requests related to this release on our
[roadmap](https://github.com/Icinga/icingaweb2-module-director/milestone/19?closed=1)
### User Interface
* FIX: restoring a basket fails when there is only one configured DB (#1716)
1.6.0
-----
### Fixed issues