mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
N°9383 - CheckToWrite inside a transition: Incorrect error message display
This commit is contained in:
@@ -1186,6 +1186,12 @@ try {
|
||||
if ($bRes) {
|
||||
try {
|
||||
$bApplyStimulus = $oObj->ApplyStimulus($sStimulus); // will write the object in the DB
|
||||
}
|
||||
catch (CoreCannotSaveObjectException $e) {
|
||||
// Rollback to the previous state... by reloading the object from the database and applying the modifications again
|
||||
$oObj = MetaModel::GetObject(get_class($oObj), $oObj->GetKey());
|
||||
$oObj->UpdateObjectFromPostedForm('', array_keys($aExpectedAttributes), $aExpectedAttributes);
|
||||
$sIssues = implode(' ', $e->getIssues());
|
||||
} catch (CoreException $e) {
|
||||
// Rollback to the previous state... by reloading the object from the database and applying the modifications again
|
||||
$oObj = MetaModel::GetObject(get_class($oObj), $oObj->GetKey());
|
||||
|
||||
Reference in New Issue
Block a user