diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index d4b93d7f5..90df6f8c9 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -2177,8 +2177,13 @@ class MFElement extends Combodo\iTop\DesignElement if ($oExisting->getAttribute('_alteration') != 'removed') { $sPath = MFDocument::GetItopNodePath($oNode); $iLine = $oNode->getLineNo(); - throw new MFException($sPath.' at line '.$iLine.": could not be added (already exists)", MFException::COULD_NOT_BE_ADDED, - $iLine, $sPath); + $sExistingPath = MFDocument::GetItopNodePath($oExisting); + $iExistingLine = $oExisting->getLineNo(); + + $sExceptionMessage = <<ReplaceWithSingleNode($oNode); $sFlag = 'replaced';