[Bug 38963] New: Deletion of bibliographic record can cause search errors in OPAC
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Bug ID: 38963 Summary: Deletion of bibliographic record can cause search errors in OPAC Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org Same has Bug 37425 for OPAC search Bug 35558 added a check to see if the associated biblio has local cover images, however, when a biblio is deleted there is a delay in the background job reindexing the biblio. This can lead to 500 errors when a search retrieves the biblio before it has been removed from the index. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |37425 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37425 [Bug 37425] Deletion of bibliographic record can cause search errors -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |fridolin.somers@biblibre.co | |m Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 177105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177105&action=edit Bug 37425: Check for existence of biblio object before fetching cover images at OPAC Attaching patch manually cause issue with git-bz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 177136 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177136&action=edit Bug 38963: Check for existence of biblio object before fetching cover images in the OPAC This patch adds a conditional to ensure the biblio object has been retrieved and assumes no cover images otherwise. This is similar to bug 37425 that fixed the issue for the staff interface. Test plan: 1. Enable the OPACLocalCoverImages system preference. 2. Search in the OPAC (for example, attic). 3. Find the biblionumber for one of the results and delete it from the database using SQL: DELETE FROM biblio WHERE biblionumber=3; 4. Search again. NOTE: Steps 3 and 4 need to be done very quickly to generate the error. I had the terminal open with the SQL already loaded, and the browser also open. 5. Error trace generated: Can't call method "cover_images" on an undefined value at /kohadevbox/koha/opac/opac-search.pl line 702. at /kohadevbox/koha/opac/opac-search.pl line 701 6. Reindex, confirm error is gone: koha-rebuild-zebra -d -f -v kohadev 7. Apply the patch. 8. Repeat steps 2 to 4 - I searched for perl and used biblionumber 13. 9. No error generated 10. Reindex and repeat search and confirm no error. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Attachment #177105|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Comment on attachment 177105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177105 Bug 37425: Check for existence of biblio object before fetching cover images at OPAC I had trouble applying the patch, so ended up recreating and adding a test plan adapted from bug 37425. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes searching in the release notes| |OPAC when the | |OPACLocalCoverImages system | |preference is enabled. In | |some circumstances an error | |is generated (Can't call | |method "cover_images" on an | |undefined value...) when a | |record is deleted, a search | |is made, but the search | |index is not yet updated. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Sorry folks but I'm not able to reproduce. I was tempted to PQA it anyway, since it's a reasonable change, and I know that I've had this problem occur in prod before... But I actually can't get OPACLocalCoverImages to work at all in main. Is it currently working for you folk? I can get a local cover image to appear in the staff interface detail/results and the OPAC detail, but not the OPAC results... It doesn't look related to this change, but I think I'm going to hold off for the moment... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38981 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Ok I think the problem with the local cover images is because of bug 38981 but that's not directly related to this. It just makes it harder to test... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- Going to QA this one anyway. Note that I've fixed up the author so that it's back to Frido again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #6)
Going to QA this one anyway.
Note that I've fixed up the author so that it's back to Frido again.
I added a breakpoint in the "verify_cover_images" function on opac-search.pl, so that I was able to verify that the HTML does get created for records that rely on the data being updated by this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177136|0 |1 is obsolete| | --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Created attachment 177207 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177207&action=edit Bug 38963: Check for existence of biblio object before fetching cover images in the OPAC This patch adds a conditional to ensure the biblio object has been retrieved and assumes no cover images otherwise. This is similar to bug 37425 that fixed the issue for the staff interface. Test plan: 1. Enable the OPACLocalCoverImages system preference. 2. Search in the OPAC (for example, attic). 3. Find the biblionumber for one of the results and delete it from the database using SQL: DELETE FROM biblio WHERE biblionumber=3; 4. Search again. NOTE: Steps 3 and 4 need to be done very quickly to generate the error. I had the terminal open with the SQL already loaded, and the browser also open. 5. Error trace generated: Can't call method "cover_images" on an undefined value at /kohadevbox/koha/opac/opac-search.pl line 702. at /kohadevbox/koha/opac/opac-search.pl line 701 6. Reindex, confirm error is gone: koha-rebuild-zebra -d -f -v kohadev 7. Apply the patch. 8. Repeat steps 2 to 4 - I searched for perl and used biblionumber 13. 9. No error generated 10. Reindex and repeat search and confirm no error. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- Note: While I think that this change is reasonable, since we've already done it before, and it prevents a crash... it's still not quite a full solution. -- Frido's test plan seemed to require a race condition, but I've found a way to reproduce it without the race. In koha-testing-docker, without the patch, change OpacHiddenItemsHidesRecord to "Don't hide" and then delete a bib from the DB using SQL. Do a search that should retrieve the record. It'll throw a fatal error. (If you have OpacHiddenItemsHidesRecord enabled, the record will be silently hidden without an error.) If you apply the patch, the fatal error goes away. *However*, your deleted bibs will appear in your search results, and if you click on one of them you'll get a 404. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- In theory, it might make more sense to just hide the bib record in the results if it no longer appears in the search results. It's a bit ugly, but it's no uglier than OpacHiddenItems. Then again... you see the same thing on retail websites. Sometimes you click on a result and then you get a "Product not found" message. Anyway... there's additional proof that this patch works as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00 |25.05.00,24.11.08 released in| | CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #12 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Pushed into 24.11.x for 24.11.08 nice work everyone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #13 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38963 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED --- Comment #14 from David Nind <david@davidnind.com> --- Bug fix, no change to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org