diff --git a/VERSIONS_HOTLINE/118997 b/VERSIONS_HOTLINE/118997 new file mode 100644 index 0000000000000000000000000000000000000000..d379c835514071c02847d01d0b5b90a3fb7a9078 --- /dev/null +++ b/VERSIONS_HOTLINE/118997 @@ -0,0 +1 @@ + - ticket #118997 : Correction de la génération des vignettes de notices lorsqu'elles ne sont pas fournies par le SIGB et liées via FRBR à un album. La notice prend la vignette de l'album. \ No newline at end of file diff --git a/library/Class/Notice/Thumbnail/ProviderRecordWithAlbum.php b/library/Class/Notice/Thumbnail/ProviderRecordWithAlbum.php index a6e779c38c3447ff077fad6240b56ce655e9f900..d7970be7602d585b6bc49e1f7f9b7bfddabab6d0 100644 --- a/library/Class/Notice/Thumbnail/ProviderRecordWithAlbum.php +++ b/library/Class/Notice/Thumbnail/ProviderRecordWithAlbum.php @@ -33,8 +33,9 @@ class Class_Notice_Thumbnail_ProviderRecordWithAlbum } if (!$album) return null; - if ($url = $album->getThumbnailUrl()) - return $url; + + if ($album->hasThumbnailUrl()) + return $album->getThumbnailPath(); return $album->getFirstImagePathFoundInResources(); } diff --git a/tests/library/Class/NoticeTest.php b/tests/library/Class/NoticeTest.php index 708957dc31a6ce77b9b5f221c2c892d422bce22a..9c3e9563d872709aba9b35567a028bb91ca46855 100644 --- a/tests/library/Class/NoticeTest.php +++ b/tests/library/Class/NoticeTest.php @@ -214,7 +214,7 @@ class NoticeVignetteTest extends ModelTestCase { $image_factory = $this->mock() ->whenCalled('newImage') - ->with($album->getThumbnailUrl()) + ->with($album->getThumbnailPath()) ->answers($this->mock() ->whenCalled('thumbnailImage')->answers(null) ->whenCalled('writeImage')->answers(null))