diff --git a/cosmogramme/VERSIONS_HOTLINE/58261 b/cosmogramme/VERSIONS_HOTLINE/58261 new file mode 100644 index 0000000000000000000000000000000000000000..13761486c2d1c740b8973384969ed6bdc6fb80e4 --- /dev/null +++ b/cosmogramme/VERSIONS_HOTLINE/58261 @@ -0,0 +1 @@ + - ticket #58261 : intégration Bibliondemand : correction de la mise à jour des notices \ 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 183fc572f1438187660c09c54bc91a0295468b03..632a62597bbf468ad774444466e69a8eeb32982a 100644 --- a/cosmogramme/php/classes/classe_notice_integration.php +++ b/cosmogramme/php/classes/classe_notice_integration.php @@ -585,7 +585,9 @@ class notice_integration { if (!$this->notice['titre_princ']) $this->statut = static::RECORD_UPDATE; - if (Class_IntProfilDonnees::FORMAT_DUBLIN_CORE == $this->format) + if (in_array($this->format, + [ Class_IntProfilDonnees::FORMAT_DUBLIN_CORE, + Class_IntProfilDonnees::FORMAT_BIBLIONDEMAND])) return $this->_realUpdate($existing_notice); // Zones forcees diff --git a/library/Class/Notice/DoubleFinder.php b/library/Class/Notice/DoubleFinder.php index e2c25cd15633365f4897d3de20e7f7a5bf21ce8e..603269183adc87a54249361b6361c221783e26be 100644 --- a/library/Class/Notice/DoubleFinder.php +++ b/library/Class/Notice/DoubleFinder.php @@ -53,7 +53,7 @@ class Class_Notice_DoubleFinder { return true; } - if($this->_profil && $this->_profil->isFormatDublinCore()) + if($this->_profil && ($this->_profil->isFormatDublinCore() || $this->_profil->isBibliondemand())) return false; if ($this->_id = $this->findByIdOrigine()) { diff --git a/tests/library/Class/Cosmogramme/Integration/RecordPhaseBibliondemandTest.php b/tests/library/Class/Cosmogramme/Integration/RecordPhaseBibliondemandTest.php index 46c3962d701247a379e88311c6a84008d3ac167c..d6492daf41de1ec64253741bfdb8802ada9a1bac 100644 --- a/tests/library/Class/Cosmogramme/Integration/RecordPhaseBibliondemandTest.php +++ b/tests/library/Class/Cosmogramme/Integration/RecordPhaseBibliondemandTest.php @@ -210,3 +210,54 @@ class RecordPhaseBibliondemandSimpleTest extends AbstractRecordPhaseBibliondeman $this->assertEmpty($item->getUrl()); } } + + + + + +class RecordPhaseBibliondemandUpdateTest extends AbstractRecordPhaseBibliondemandTestCase { + public function _prepareFixtures() { + parent::_prepareFixtures(); + + Class_Cosmogramme_Integration::find(999) + ->beIncrementImport() + ->save(); + + + $record = $this->fixture('Class_Notice', + ['id' => 1, + 'type_doc' => 16, + 'alpha_titre' => 'PIERO SOFFICI', + 'facettes' => 'T15', + 'clef_alpha' => 'PIEROSOFFICIQUARTET--PIEROSOFFICIQUARTET----16', + 'clef_oeuvre' => 'PIEROSOFFICIQUARTET--PIEROSOFFICIQUARTET--', + 'annee' => '', + 'unimarc' => '', + 'qualite' => 0, + 'exportable' => true, + 'date_maj' => '2016-04-25 14:39:58', + 'url_vignette' => 'http://play-assets-production.1dtouch.com/cargo/medium_8017297007164.jpg', + 'url_image' => 'http://play-assets-production.1dtouch.com/cargo/medium_8017297007164.jpg', + 'exemplaires' => [ + $this->fixture('Class_Exemplaire', + ['id' => 1, + 'activite' => 'peut être prêté', + 'zone995' => '', + 'code_barres' => 'CG62_5532b9e4e47a7d41fe81d125d3ba7863', + 'id_bib' => 3, + 'id_int_bib' => 3]) + ]]); + } + + + public function setUp() { + parent::setUp(); + $this->_record = Class_Notice::find(1); + } + + + /** @test */ + public function typeDocShouldStay16() { + $this->assertEquals(16, $this->_record->getTypeDoc()); + } +} \ No newline at end of file