diff --git a/pages/UI.php b/pages/UI.php index b5a503b4aa..cbaaa1f374 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1186,6 +1186,12 @@ function DisplayNavigatorGroupTab($oP) 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());