CloneSyncRuleForm: prepare for multi-db use

This commit is contained in:
Thomas Gelf 2018-06-14 13:41:13 +02:00
parent ee48f28302
commit 1ca41c5b10

View File

@ -52,7 +52,7 @@ class CloneSyncRuleForm extends Form
$export = $this->rule->export();
$newName = $this->getValue('rule_name');
$export->rule_name = $newName;
if (SyncRule::existsWithName($newName, $this->rule->getConnection())) {
if (SyncRule::existsWithName($newName, $this->getTargetDb())) {
$this->getElement('rule_name')->addMessage('Name already exists');
}
$this->newRule = SyncRule::import($export, $this->getTargetDb());