Compare commits

..

1 Commits

Author SHA1 Message Date
Anne-Cath
1f860623c4 N°9383 - CheckToWrite inside a transition: Incorrect error message display 2026-03-10 18:29:08 +01:00

View File

@@ -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());