N°4125 - Make translations loading more robust toward APCu cache corruption or invalid dictionnary - adaptations to get current correction accepted

This commit is contained in:
odain
2021-07-28 11:14:49 +02:00
parent ed719e13c7
commit 2fe4265223
2 changed files with 26 additions and 28 deletions

View File

@@ -271,13 +271,13 @@ class Dict
// Note: For versions of APC older than 3.0.17, fetch() accepts only one parameter
//
self::$m_aData[$sLangCode] = self::GetApcService()->apc_fetch(self::$m_sApplicationPrefix.'-dict-'.$sLangCode);
if (! is_array(self::$m_aData[$sLangCode]))
{
IssueLog::Warning("APCu corrupted data (with $sLangCode dictionnary). APCu configuration and running version should be troubleshooted...");
if (self::$m_aData[$sLangCode] === false) {
unset(self::$m_aData[$sLangCode]);
}
else
{
} else if (! is_array(self::$m_aData[$sLangCode])) {
IssueLog::Warning("APCu corrupted data (with $sLangCode dictionnary). APCu configuration and running version should be troubleshooted...");
//N°4125: we dont fix issue on iTop side. just add some log to be aware of it and fix APCu instead.
$bResult = true;
} else {
$bResult = true;
}
}