diff --git a/VERSIONS_WIP/155235 b/VERSIONS_WIP/155235 new file mode 100644 index 0000000000000000000000000000000000000000..978c56dc12d8a9de45743ac586e11b4c222b6701 --- /dev/null +++ b/VERSIONS_WIP/155235 @@ -0,0 +1 @@ + - correctif #155235 : correction de l'indexation des libellés des facettes dynamiques lors de la mise à jour d'une notice \ No newline at end of file diff --git a/cosmogramme/php/classes/classe_notice_integration.php b/cosmogramme/php/classes/classe_notice_integration.php index 26fde2d3fa03d504322771616c41b627dca6d657..37833f16466fe3c9bfed6887978846af1ad3365e 100644 --- a/cosmogramme/php/classes/classe_notice_integration.php +++ b/cosmogramme/php/classes/classe_notice_integration.php @@ -716,9 +716,8 @@ class notice_integration { protected function _realUpdate($record) { $this->traiteFacettes($record->getId()); - $record - ->updateAttributes($this->noticeToDBEnreg()) - ->save(); + $record->updateAttributes($this->noticeToDBEnreg()); + (new Class_Notice_Indexation($record))->indexAndSave(); return $record->getId(); } diff --git a/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php b/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php index 45f1ba9f68115bb64ff758c6998cc7ff19fbfcae..3725d1f83af1096cb858b019847f36e43599a92d 100644 --- a/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php +++ b/cosmogramme/tests/php/classes/KohaRecordIntegrationTest.php @@ -477,6 +477,17 @@ class KohaRecordIntegrationVagabondWithThesaurusOn702DollarATest extends KohaRec $this->assertEquals('PARIS PARI HAUTH_YOSHIKAWA HAUTH_LALLOZ HAUTH_MARCEL', Class_Notice::find(1)->getOtherTerms()); } + + + /** @test */ + public function onUpdateExistingRecordShouldUpdateOtherTermsToo() { + Class_Notice::find(1) + ->setOtherTerms('AN OLD ONE') + ->assertSave(); + $this->loadNotice('unimarc_vagabond'); + $this->assertEquals('PARIS PARI HAUTH_YOSHIKAWA HAUTH_LALLOZ HAUTH_MARCEL', + Class_Notice::find(1)->getOtherTerms()); + } }