Bug 9991

Summary: De-duplicate "no cover image available" (currently in lieu of prioritizing cover image sources)
Product: Koha Reporter: David Cook <dcook>
Component: OPACAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P5 - low CC: dubyk, egpetridis, magnus
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7187
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description David Cook 2013-04-04 23:32:42 UTC
Currently, when you have the system preferences for multiple cover image sources turned on, it's possible to have multiple "No Cover Image Available" graphics appearing in the OPAC for any 1 record.

I think it would make more sense to just have 1 "No Cover Image Available" if there are actually no cover images available. Plus, if there is at least 1 cover image available, there should be 0 "No Cover Image Available" graphics appearing for that record.


One idea (purely JScript-based):

1) Add a class to each cover art span (or possibly use the existing thumbnail class for the img)
2) Then use a JScript function to loop through each record's a.p1 element (which seems to be unique...although we could always add a cover art class to it as well). 
3) If span.cover_art (or img.thumbnail) exists, remove all span.no-image elements within that a.p1 element. 
4) If span.cover_art (or img.thumbnail) does not exist AND count(span.no-image) > 1, remove every span.no-image after the first instance within that a.p1 element. 

I don't think we could do it solely with Perl or TT, because the existence of cover art is going to vary depending on several other JScript functions which run independently of each other.
Comment 1 David Cook 2022-08-22 03:15:05 UTC

*** This bug has been marked as a duplicate of bug 26933 ***