From 1f860623c41ebd2163ca4c25e710c08b6995b722 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Tue, 10 Mar 2026 18:29:08 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B09383=20-=20CheckToWrite=20inside=20a=20t?= =?UTF-8?q?ransition:=20Incorrect=20error=20message=20display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/UI.php | 6 ++++++ 1 file changed, 6 insertions(+) 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());