Commit 0ac59534 authored by Navid Sassan's avatar Navid Sassan
Browse files

fixed another problem with the datalist import

parent 85e7e026
......@@ -2,6 +2,7 @@
namespace Icinga\Module\Director\Objects;
use Icinga\Exception\NotFoundError;
use Icinga\Module\Director\Core\Json;
use Icinga\Module\Director\Data\Db\DbObjectWithSettings;
use Icinga\Module\Director\Db;
......@@ -77,11 +78,15 @@ class DirectorDatafield extends DbObjectWithSettings
$plain->settings = (object) $this->getSettings();
if (property_exists($plain->settings, 'datalist_id')) {
$plain->settings->datalist = DirectorDatalist::loadWithAutoIncId(
$plain->settings->datalist_id,
$this->getConnection()
)->get('list_name');
unset($plain->settings->datalist_id);
// It is possible that the datalist does not exists yet, but is part of the new basket
try {
$plain->settings->datalist = DirectorDatalist::loadWithAutoIncId(
$plain->settings->datalist_id,
$this->getConnection()
)->get('list_name');
} catch (NotFoundError $e) {
}
unset($plain->settings->datalist_id);
}
return $plain;
......
Name: Icinga Director
Version: 1.7.2.2020020402
Version: 1.7.2.2020020403
Depends: reactbundle (>=0.7.0), ipl (>=0.3.0), incubator (>=0.5.0)
Description: Director - Config tool for Icinga 2
Icinga Director is a configuration tool that has been designed to make
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment