diff --git a/VERSIONS_HOTLINE/29825 b/VERSIONS_HOTLINE/29825 new file mode 100644 index 0000000000000000000000000000000000000000..1202e542d3caa6f1dd7ec806e20565b94958df00 --- /dev/null +++ b/VERSIONS_HOTLINE/29825 @@ -0,0 +1 @@ + - ticket #29825 : suppression des facettes thesaurus erronnées dans le phase "clean" de l'intégration des notices \ No newline at end of file diff --git a/library/Class/Cosmogramme/Integration/PhaseNotice.php b/library/Class/Cosmogramme/Integration/PhaseNotice.php index fd36087a107b131ed3b75e0209b6e02e185b20bb..bb2799ae99f8d8d841f7d2c833067cca155a0631 100644 --- a/library/Class/Cosmogramme/Integration/PhaseNotice.php +++ b/library/Class/Cosmogramme/Integration/PhaseNotice.php @@ -64,6 +64,9 @@ class Class_Cosmogramme_Integration_PhaseNotice extends Class_Cosmogramme_Integr $nb1 = Class_NoticeSuccincte::countBy(['id_bib' => $id_int_bib]); Class_NoticeSuccincte::deleteBy(['id_bib' => $id_int_bib]); + Class_CodifThesaurus::deleteBy(['code' => null, + 'rules' => null]); + $del_msg .= '<span class="vert">' . $nb . ' exemplaires supprimés</span><br>'; $del_msg .= '<span class="vert">' . $nb1 . ' notices succinctes supprimées</span><br><br>'; $this->_log->ecrire($del_msg); diff --git a/tests/library/Class/Cosmogramme/Integration/PhaseNoticeTest.php b/tests/library/Class/Cosmogramme/Integration/PhaseNoticeTest.php index b2c762854efe722d9defdce8303d60f1f9ea0ba4..57d486e32ef6905a6c0fc1b91797368d741d663a 100644 --- a/tests/library/Class/Cosmogramme/Integration/PhaseNoticeTest.php +++ b/tests/library/Class/Cosmogramme/Integration/PhaseNoticeTest.php @@ -25,10 +25,24 @@ require_once __DIR__ . '/PhaseNoticeTestCase.php'; class PhaseNoticeImportTest extends PhaseNoticeTestCase { protected function _prepareFixtures() { parent::_prepareFixtures(); + $this->fixture('Class_CosmoVar', ['id' => 'mode_doublon', 'valeur' => Class_CosmoVar::DOUBLE_SEARCH_ALPHA_KEY]); + $this->fixture('Class_IntBib', + ['id' => 1, + 'comm_sigb' => Class_IntBib::COM_NANOOK, + 'comm_params' => ['url_serveur' => 'http://bib.valensol.net']]); + + $this->fixture('Class_CodifThesaurus', + ['id' => 1, + 'libelle' => 'AGE', + 'code' => null, + 'rules' => null]); + + Class_CodifThesaurus::addFacetForSigb('Public' , '993$a',Class_IntBib::COM_NANOOK); + $this->fixture('Class_Exemplaire', ['id' => 889039, 'id_int_bib' => 2]); @@ -76,6 +90,12 @@ class PhaseNoticeImportTest extends PhaseNoticeTestCase { } + /** @test */ + public function onlyPublicFacetShouldBeInDb() { + $this->assertSame([Class_CodifThesaurus::findFirstBy(['libelle_facette' => 'Public'])], Class_CodifThesaurus::findAll()); + } + + /** * @test * @see http://forge.afi-sa.fr/issues/26261