Summary: | Create cover image even when there is no record identificator | ||
---|---|---|---|
Product: | Koha | Reporter: | Hugo Agud <hagud> |
Component: | Cataloging | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Josef Moravec <josef.moravec> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrew, caroline.cyr-la-rose, fridolin.somers, jonathan.druart, josef.moravec, m.de.rooy, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.01
|
|
Circulation function: | |||
Bug Depends on: | 22445 | ||
Bug Blocks: | |||
Attachments: |
Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated
Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated |
Description
Hugo Agud
2020-11-04 08:04:38 UTC
Please use the depends on field in such cases to link the bugs together, thishelps to identify which versions we have to fix and to alert anyone involved in hte previous bug. Created attachment 113124 [details] [review] Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated In case a custom cover image url is used to generate the cover image of bibliographic records, we should not build one if the record does not have the necessary data. For instance if you have CustomCoverImagesURL set to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb and a biblio does not have the isbn defined, we should not generate and empty image (empty or invalid src) Test plan: 0. Set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb Enable CustomCoverImages and OPACCustomCoverImages To highlight the issue you should disable LocalCoverImages and OPACLocalCoverImages. 1. Make sure you have some of your bibliographic records with a valid isbn 2. Make sure you have at least 1 bibliographic record without an isbn set 3. Visit the search result and detail views (OPAC and staff interfaces) => Without this patch you should see a "Cover image" link, and an empty block/div on the detail page => With this patch applied you should only see images when the url can be generated Note that the problem will persist if the isbn is not valid (ie. no image is generated) Sponsored-by: Orex Digital Created attachment 113128 [details] [review] Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated In case a custom cover image url is used to generate the cover image of bibliographic records, we should not build one if the record does not have the necessary data. For instance if you have CustomCoverImagesURL set to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb and a biblio does not have the isbn defined, we should not generate and empty image (empty or invalid src) Test plan: 0. Set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb Enable CustomCoverImages and OPACCustomCoverImages To highlight the issue you should disable LocalCoverImages and OPACLocalCoverImages. 1. Make sure you have some of your bibliographic records with a valid isbn 2. Make sure you have at least 1 bibliographic record without an isbn set 3. Visit the search result and detail views (OPAC and staff interfaces) => Without this patch you should see a "Cover image" link, and an empty block/div on the detail page => With this patch applied you should only see images when the url can be generated Note that the problem will persist if the isbn is not valid (ie. no image is generated) Sponsored-by: Orex Digital Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 114452 [details] [review] Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated In case a custom cover image url is used to generate the cover image of bibliographic records, we should not build one if the record does not have the necessary data. For instance if you have CustomCoverImagesURL set to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb and a biblio does not have the isbn defined, we should not generate and empty image (empty or invalid src) Test plan: 0. Set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb Enable CustomCoverImages and OPACCustomCoverImages To highlight the issue you should disable LocalCoverImages and OPACLocalCoverImages. 1. Make sure you have some of your bibliographic records with a valid isbn 2. Make sure you have at least 1 bibliographic record without an isbn set 3. Visit the search result and detail views (OPAC and staff interfaces) => Without this patch you should see a "Cover image" link, and an empty block/div on the detail page => With this patch applied you should only see images when the url can be generated Note that the problem will persist if the isbn is not valid (ie. no image is generated) Sponsored-by: Orex Digital Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.01 Doesn't apply cleanly to 20.05, please rebase if needed |