diff --git a/core/cmdbsource.class.inc.php b/core/cmdbsource.class.inc.php index 39817aa85..e5e59be82 100644 --- a/core/cmdbsource.class.inc.php +++ b/core/cmdbsource.class.inc.php @@ -611,12 +611,12 @@ class CMDBSource catch (mysqli_sql_exception $e) { self::LogDeadLock($e, true); - throw new MySQLException('Failed to issue SQL query', array('query' => $sSql, $e)); + throw new MySQLException('Failed to issue SQL query', ['query' => $sSql, $e, 'stack' => $e->getTraceAsString()]); } finally { $oKPI->ComputeStats('Query exec (mySQL)', $sSql); } if ($oResult === false) { - $aContext = array('query' => $sSql); + $aContext = ["\nstack" => (new Exception(''))->getTraceAsString(), "\nquery" => $sSql]; $iMySqlErrorNo = DbConnectionWrapper::GetDbConnection(true)->errno; $aMySqlHasGoneAwayErrorCodes = MySQLHasGoneAwayException::getErrorCodes(); diff --git a/sources/Controller/Base/Layout/ObjectController.php b/sources/Controller/Base/Layout/ObjectController.php index 137d7827a..bcbeb8629 100644 --- a/sources/Controller/Base/Layout/ObjectController.php +++ b/sources/Controller/Base/Layout/ObjectController.php @@ -664,6 +664,7 @@ JS; $aResult['data'] = ['error_message' => $e->getHtmlMessage()]; } else { $oPage->AddHeaderMessage($e->getHtmlMessage(), 'message_error'); + $oObj->Reload(); $oObj->DisplayModifyForm($oPage, array('wizard_container' => true)); // wizard_container: display the wizard border and the title }