We have identified an issue with bug 22445, when we define the url we add the value to identify the id and create the link The link is created even there is no identification Example: https://xxxxx.xxxx.cat/cobertes.php?isbn={isbn}&institucio=xxxx If the record has not isbn, the patch create the thumnail with empty value, the patch should avoid create the thumbnail if the {}values are empty be aware that we could have more than one identifier {isbn}{issn}, it should check both values
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