diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index e83a07f6b..40324d450 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -8543,7 +8543,7 @@ class AttributeBlob extends AttributeDefinition $sFingerprint = ''; if ($value instanceOf ormDocument) { - $sFingerprint = md5($value->GetData()); + $sFingerprint = $value->GetSignature(); } return $sFingerprint; diff --git a/core/ormcaselog.class.inc.php b/core/ormcaselog.class.inc.php index 3fad647de..86a93644e 100644 --- a/core/ormcaselog.class.inc.php +++ b/core/ormcaselog.class.inc.php @@ -170,7 +170,7 @@ class ormCaseLog { } // Process the case of an eventual remainder (quick migration of AttributeText fields) - if ($iPos < (strlen($this->m_sLog) - 1)) + if ($iPos < (utils::StrLen($this->m_sLog) - 1)) { $sTextEntry = substr($this->m_sLog, $iPos); @@ -293,7 +293,7 @@ class ormCaseLog { } // Process the case of an eventual remainder (quick migration of AttributeText fields) - if ($iPos < (strlen($this->m_sLog) - 1)) { + if ($iPos < (utils::StrLen($this->m_sLog) - 1)) { $sTextEntry = substr($this->m_sLog, $iPos); $sTextEntry = str_replace(array("\r\n", "\n", "\r"), "
", utils::EscapeHtml($sTextEntry)); @@ -374,7 +374,7 @@ class ormCaseLog { } // Process the case of an eventual remainder (quick migration of AttributeText fields) - if ($iPos < (strlen($this->m_sLog) - 1)) { + if ($iPos < (utils::StrLen($this->m_sLog) - 1)) { $sTextEntry = substr($this->m_sLog, $iPos); $sTextEntry = str_replace(array("\r\n", "\n", "\r"), "
", utils::EscapeHtml($sTextEntry)); @@ -468,7 +468,7 @@ class ormCaseLog { $oBlock->AddSubBlock($oCollapsibleBlock); } // Process the case of an eventual remainder (quick migration of AttributeText fields) - if ($iPos < (strlen($this->m_sLog) - 1)) { + if ($iPos < (utils::StrLen($this->m_sLog) - 1)) { // In this case the format is always "text" $sTextEntry = substr($this->m_sLog, $iPos); $sTextEntry = str_replace(array("\r\n", "\n", "\r"), "
", utils::EscapeHtml($sTextEntry)); diff --git a/core/ormdocument.class.inc.php b/core/ormdocument.class.inc.php index 60ef1614c..fc52017df 100644 --- a/core/ormdocument.class.inc.php +++ b/core/ormdocument.class.inc.php @@ -344,6 +344,6 @@ class ormDocument */ public function GetSignature(): string { - return md5($this->GetData()); + return md5($this->GetData() ?? ''); } } diff --git a/tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php b/tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php index e0bbc2a81..1a0c19783 100644 --- a/tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php +++ b/tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php @@ -158,14 +158,20 @@ class DictionariesConsistencyTest extends ItopTestCase public function DictionaryFileProvider(): array { $this->setUp(); - $sAppRoot = static::GetAppRoot(); + $aDictFiles = array_merge( glob($sAppRoot.'datamodels/2.x/*/*.dict*.php'), // legacy form in modules glob($sAppRoot.'datamodels/2.x/*/dictionaries/*.dict*.php'), // modern form in modules - glob($sAppRoot.'dictionaries/*.dict*.php') // framework + glob($sAppRoot.'dictionaries/*.dict*.php'), // framework + + //--- Following should not be present in packages, but are convenient for local debugging ! + glob($sAppRoot.'extensions/*/*.dict*.php'), + glob($sAppRoot.'extensions/*/dictionaries/*.dict*.php'), ); + + $aTestCases = array(); foreach ($aDictFiles as $sDictFile) { $aTestCases[$sDictFile] = array('sDictFile' => $sDictFile);