Library browser and search stop working after update to v27

Hello,
I updated Gibbon to v27.0.1 but I figured out that the library browser stop working. I use this brwoser as student and parent interface.

The books are not shown and the search is not working
I comment out the code for the age filters in the code, the location, and others and the browser shows only few of the books that have picture.

In our case the books has no location and not assiged to shelf. Those information are embedded in the book ID.

Do you have any idea how the new update works in comparison to the older one?

Hi @Abbadi My apologies for the delay. Is this still not working for you?

Hi Sandra,
Thank you for asking.
We were in summer pause, we didn’t have the chance to dig more into the problem. But yes the Library brawser is still not working.

As I remember, the problem was in the filters where they consider No-entry as a condition and filter out the results. Where I expect to conceder no-entry as “don’t apply corresponding filter”.

Hi @Abbadi Thanks for your update. I’ve tried to replicate the issue you’ve described locally but haven’t been able to. Would you be able to share some examples of the book data that you are using (exports or screenshots), and some steps I could take to try to reproduce what you are seeing on your end?

Hi Sandra,
here are the old view where 539 books are appeared in the library.

now the new version of the library module it shows only the books with Pictures.

The search is not working in general.
The only two book I can search on is what appear above (the books with picture) but the search works only when I check “Choose Books outside of Library” then the search gives the results.

here are the CSV database extraction for the first few 5 books (the first one with a picture). you can use them as test data.

gibbonLibraryItemID,gibbonLibraryItemIDParent,gibbonLibraryTypeID,id,name,producer,fields,vendor,purchaseDate,invoiceNumber,cost,imageType,imageLocation,comment,gibbonSpaceID,locationDetail,ownershipType,gibbonPersonIDOwnership,gibbonDepartmentID,replacement,replacementCost,gibbonSchoolYearIDReplacement,physicalCondition,bookable,borrowable,status,gibbonPersonIDStatusResponsible,gibbonPersonIDStatusRecorder,timestampStatus,returnExpected,returnAction,gibbonPersonIDReturnAction,gibbonPersonIDCreator,timestampCreator,gibbonPersonIDUpdate,timestampUpdate
574,0,4,A04-06A001,ثلاجة العصافير,"مكرم، محمد","{""Format"":""Book"",""Publisher"":""\u062f\u0627\u0631 \u0627\u0644\u0631\u0628\u064a\u0639 \u0644\u0644\u0646\u0634\u0631"",""Publication Date"":""2011-01-01"",""Country of Publication"":"""",""Edition"":"""",""ISBN10"":""9933161369"",""ISBN13"":""9789933161361"",""Description"":"""",""Subjects"":"""",""Collection"":"""",""Control Number"":""9 789933 161361"",""Cataloging Authority"":"""",""Reader Age (Youngest)"":""4"",""Reader Age (Oldest)"":""6"",""Page Count"":""0"",""Height"":"""",""Width"":"""",""Thickness"":"""",""Language"":""ar"",""Link"":""http:\/\/books.google.de\/books?id=kS44jwEACAAJ&dq=isbn:9933161369&hl=&source=gbs_api""}",,2011-01-01,,0,Link,http://books.google.com/books/content?id=kS44jwEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api,,0,,School,0,0,Y,0,0,,N,Y,Available,0,0,,,,0,0,0000-00-00 00:00:00,1,2024-07-17 12:51:48
575,0,4,A04-06A002,أخي يبكي كثيرا,سيما ربيع,"{""Format"":"""",""Publisher"":""\u062f\u0627\u0631 \u0631\u0628\u064a\u0639 \u0644\u0644\u0646\u0634\u0631"",""Publication Date"":""2011-01-01"",""Country of Publication"":"""",""Edition"":"""",""ISBN10"":"""",""ISBN13"":"""",""Description"":"""",""Subjects"":"""",""Collection"":"""",""Control Number"":"""",""Cataloging Authority"":"""",""Reader Age (Youngest)"":""4"",""Reader Age (Oldest)"":""6"",""Page Count"":""16"",""Height"":"""",""Width"":"""",""Thickness"":"""",""Language"":""\u0627\u0644\u0639\u0631\u0628\u064a\u0629"",""Link"":""""}",,2024-07-17,,0,,,,17,,School,0,0,Y,0,0,,N,Y,Available,0,0,,,,0,0,0000-00-00 00:00:00,1,2024-09-10 17:51:05
576,0,4,A04-06A003,Teeth,Noura,"{""Publisher"":""\u062f\u0627\u0631 \u0631\u0628\u064a\u0639 \u0644\u0644\u0646\u0634\u0631"",""Publication Date"":""2011-01-01"",""Edition"":"""",""ISBN13"":"""",""Description"":"""",""Control Number"":"""",""Reader Age (Youngest)"":""4"",""Reader Age (Oldest)"":""6"",""Page Count"":""16"",""Language"":""\u0627\u0644\u0639\u0631\u0628\u064a\u0629""}",,2024-07-17,,0,,,,0,,School,0,0,Y,0,0,,N,Y,Available,0,0,,,,0,0,0000-00-00 00:00:00,0,
577,0,4,A04-06A004,Farah,Rama,"{""Publisher"":""\u062f\u0627\u0631 \u0631\u0628\u064a\u0639 \u0644\u0644\u0646\u0634\u0631"",""Publication Date"":""2011-01-01"",""Edition"":"""",""ISBN13"":"""",""Description"":"""",""Control Number"":"""",""Reader Age (Youngest)"":""4"",""Reader Age (Oldest)"":""6"",""Page Count"":""16"",""Language"":""\u0627\u0644\u0639\u0631\u0628\u064a\u0629""}",,2024-07-17,,0,,,,0,,School,0,0,Y,0,0,,N,Y,Available,0,0,,,,0,0,0000-00-00 00:00:00,0,
578,0,4,A04-07A005,Big and small Animals,,"{""Publisher"":""WorldBook, Inc"",""Publication Date"":null,""Edition"":""\u0639\u0627\u0644\u0645 \u0627\u0644\u0645\u0639\u0631\u0641\u0629 \u0627\u0644\u0645\u0628\u0643\u0631"",""ISBN13"":"""",""Description"":"""",""Control Number"":"""",""Reader Age (Youngest)"":""4"",""Reader Age (Oldest)"":""7"",""Page Count"":""10"",""Language"":""\u0627\u0644\u0639\u0631\u0628\u064a\u0629""}",,,,0,,,,0,,School,0,0,Y,0,0,,N,Y,Available,0,0,,,,0,0,0000-00-00 00:00:00,0,

I tried to recreate the issue and could identify following problems:

  1. By default, library_browse.php statically filters out all books which are not located in the location called “Library”. Its not based on country or language. If the locations name is not exactly “Library” (eg Bibliothek in German), the books will get filtered out by default unless the user is attentive enough to not miss the check-box “include books outside of Library”. But in that case all the books are included and not only “Library’s”. My proposal for fix here is to have the check box checked by default, and the user can actively deselect it if too many unwanted results are shown. The confusion of having too many results seems better than the confusion of having no results at all.

  2. The template librarySearch.twig.html silently hides books from the search results if they don’t have cover art associated in the database. I think the easiest fix here would be to have a default image shown, eg, that states “image not available”.

  3. Abother minor and unrelated issue to the original post here but in the same file (library_browse.php) so I mention it here: Normally when a user performs a search in (or outside) library, the search criteria are displayed at the top of the results—except the criteria of readers age. I guess the feature to search on basis of readers age was added not too long ago, so this part got missed. This also seems like a straightforward fix.

I have created a pull request, please see if the fixes makes sense.

Pull request: