Merge remote-tracking branch 'origin/support/3.1' into develop

This commit is contained in:
Anne-Cath
2024-01-15 16:35:57 +01:00
8 changed files with 208 additions and 71 deletions

View File

@@ -1932,17 +1932,13 @@ class SynchroLog extends DBObject
$oAttDef = MetaModel::GetAttributeDef(get_class($this), 'traces');
$iMaxSize = $oAttDef->GetMaxSize();
if (strlen($sPrevTrace) > 0)
{
if (strlen($sPrevTrace) > 0) {
$sTrace = $sPrevTrace."\n".implode("\n", $this->m_aTraces);
}
else
{
} else {
$sTrace = implode("\n", $this->m_aTraces);
}
if (strlen($sTrace) >= $iMaxSize)
{
$sTrace = substr($sTrace, 0, $iMaxSize - 255)."...\nTruncated (size: ".strlen($sTrace).')';
if (mb_strlen($sTrace) >= $iMaxSize) {
$sTrace = mb_substr($sTrace, 0, $iMaxSize - 40)."...\nTruncated (size: ".mb_strlen($sTrace).')';
}
$this->Set('traces', $sTrace);
@@ -2147,9 +2143,8 @@ class SynchroReplica extends DBObject implements iDisplay
break;
}
if (strlen($sWarningMessage) > $MAX_WARNING_LENGTH)
{
$sWarningMessage = substr($sWarningMessage, 0, $MAX_WARNING_LENGTH - 3).'...';
if (mb_strlen($sWarningMessage) > $MAX_WARNING_LENGTH) {
$sWarningMessage = mb_substr($sWarningMessage, 0, $MAX_WARNING_LENGTH - 3).'...';
}
$this->Set('status_last_warning', $sWarningMessage);
@@ -2189,17 +2184,13 @@ class SynchroReplica extends DBObject implements iDisplay
public function SetLastError($sMessage, $oException = null)
{
if ($oException)
{
if ($oException) {
$sText = $sMessage.$oException->getMessage();
}
else
{
} else {
$sText = $sMessage;
}
if (strlen($sText) > 255)
{
$sText = substr($sText, 0, 200).'...('.strlen($sText).' chars)...';
if (mb_strlen($sText) > 255) {
$sText = mb_substr($sText, 0, 200).'...('.mb_strlen($sText).' chars)...';
}
$this->Set('status_last_error', $sText);
}