diff --git a/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php b/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php index a665b4e31a7e164c3cbea62f5146d005f80d0908..70ceb22dd5deba2f3765e91b682891bfe1cc9ce4 100644 --- a/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php +++ b/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php @@ -213,7 +213,7 @@ class KohaRecordIntegrationVagabondWithThesaurusOn702DollarATest extends KohaRec ['id' => 5, 'libelle' => 'd\'après l\'oeuvre d\'Eiji Yoshikawa, "Miyamoto Musashi"', 'id_thesaurus' => 'SUMM0001', - 'id_origine' => 'D\'APRèS L\'OEUVRE D\'', + 'id_origine' => 'D\'APRèS L\'OEUVRE D\'E', 'code' => 'summary' ]); diff --git a/library/Class/CodifThesaurus.php b/library/Class/CodifThesaurus.php index 56984d5aa6f2d278ddea4bc5cc4d3928985f6707..8f3a0663eb5e27536efbb6066103da62c8486d1f 100644 --- a/library/Class/CodifThesaurus.php +++ b/library/Class/CodifThesaurus.php @@ -243,8 +243,9 @@ class Class_CodifThesaurus extends Storm_Model_Abstract { public function getOrCreateChild($id_origine, $label) { - if (!$entry = $this->getLoader()->findFirstBy(['code' => $this->getCode(), - 'id_origine' => substr($id_origine, 0, self::COLUMN_ORIGIN_SIZE)])) { + if (!$entry = $this->getLoader() + ->findFirstBy(['code' => $this->getCode(), + 'id_origine' => mb_substr($id_origine, 0, self::COLUMN_ORIGIN_SIZE, 'UTF-8')])) { $entry = $this ->newChildEntry() ->updateAttributes(['id_origine' => $id_origine,