Open minusdavid opened 3 years ago
One way to get around this is to use a report that is likely to always output at least 2 results.
Here's a report that will show a random selection of the 30 records with new items: SELECT * FROM ( SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title, max(i.dateaccessioned) as dateacc FROM items i LEFT JOIN biblioitems m USING (biblioitemnumber) LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) WHERE m.isbn IS NOT NULL AND m.isbn != '' GROUP BY biblionumber HAVING isbn != "" ORDER BY dateacc desc LIMIT 30 ) u ORDER BY rand()
Ah foiled... this works in the mysql client but it works differently in Koha. I seem to recall reading something about this...
Here we go. Because MySQL is weird:
SELECT * FROM ( SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title, max(i.dateaccessioned) FROM items i LEFT JOIN biblioitems m USING (biblioitemnumber) LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) WHERE m.isbn IS NOT NULL AND m.isbn != '' GROUP BY biblionumber HAVING isbn != "" ORDER BY max(i.dateaccessioned) desc LIMIT 30 ) subq ORDER BY rand() LIMIT 30
I think this might be the latest query that includes cover images...
SELECT * FROM ( SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title, max(i.dateaccessioned), c.biblionumber as localcover FROM items i LEFT JOIN biblioitems m USING (biblioitemnumber) LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) LEFT OUTER JOIN cover_images c ON (i.biblionumber = c.biblionumber) WHERE m.isbn IS NOT NULL AND m.isbn != '' GROUP BY biblionumber HAVING isbn != "" ORDER BY max(i.dateaccessioned) desc LIMIT 30 ) subq ORDER BY rand() LIMIT 30
Plugin version: v2.4.47
A librarian noticed that the word spacing is incorrect for their coverflow output when there is only 1 result.
The "ul.flipstercontainer" element is created correctly, but its child "li" element doesn't have any flipster classes and there is no "div.flipsteritem__content" element.