[Bug 11329] New: Check for marc record in opac-showmarc
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Bug ID: 11329 Summary: Check for marc record in opac-showmarc Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: OPAC Assignee: m.de.rooy@rijksmuseum.nl Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Instead of just running as_formatted, check if GetMarcBiblio returned a reference. If you e.g. did not pass an id, return 404 instead of 500. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Severity|enhancement |trivial -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 --- Comment #1 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 23231 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23231&action=edit Bug 11329: Check for marc record in opac-showmarc Instead of just running as_formatted, check if GetMarcBiblio returned a reference. If you e.g. did not pass an id, return 404 instead of 500. Consistent with opac-export.pl Test plan: [1] Run opac-showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 --- Comment #2 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 23232 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23232&action=edit Bug 11329: Check for marc record in catalogue/showmarc Intranet counterpart patch. Same check as in opac/opac-showmarc. Test plan: [1] Run showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Marcel, why do you think that these patches are necessary? I suppose, in the case of the OPAC, it might make sense to return a 404 instead of a 500, but when is an opac-showmarc.pl query string going to be malformed? In the case of the staff client, I got a 404 both before/after trying the patch, so I'm not sure that it's necessary. I imagine that there must already be checking higher up in showmarc.pl? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 --- Comment #4 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #3) > Marcel, why do you think that these patches are necessary? Hi David. Thanks for testing. They are not that important :) But I would like to reduce the 500s in my log (especially from opac, mainly coming from Googlebot). Testing if something is what it should be, cannot hurt BTW :) > I suppose, in the case of the OPAC, it might make sense to return a 404 > instead of a 500, but when is an opac-showmarc.pl query string going to be > malformed? That is indeed somewhat less likely, but not imaginary. 1) Someone saved a URL. The record does no longer exist. 2) User 1 deleted the record, Zebra has not been updated yet. User 2 clicks on the link. 3) If the marcxml of a record is malformed (due to some earlier error or so), GetMarcBiblio returns undef. We should check that and not assume a valid MARC::Record object. > In the case of the staff client, I got a 404 both before/after trying the > patch, so I'm not sure that it's necessary. I imagine that there must > already be checking higher up in showmarc.pl? Really? I got the following 500 error on an wrong biblio number: Can't call method "as_formatted" on an undefined value at /usr/share/koha/testclone/catalogue/showmarc.pl line 82. You should be able to repeat this error in current master.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23231|0 |1 is obsolete| | Attachment #23232|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 24417 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24417&action=edit Bug 11329: Check for marc record in opac-showmarc Instead of just running as_formatted, check if GetMarcBiblio returned a reference. If you e.g. did not pass an id, return 404 instead of 500. Consistent with opac-export.pl Test plan: [1] Run opac-showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 24418 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24418&action=edit Bug 11329: Check for marc record in catalogue/showmarc Intranet counterpart patch. Same check as in opac/opac-showmarc. Test plan: [1] Run showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- It work well for me, i am redirected to 404. It is not the best, I think we should catch the error and display a suitable warning. But it improves the actual state. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24417|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24500 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24500&action=edit Bug 11329: Check for marc record in opac-showmarc Instead of just running as_formatted, check if GetMarcBiblio returned a reference. If you e.g. did not pass an id, return 404 instead of 500. Consistent with opac-export.pl Test plan: [1] Run opac-showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24500|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24501 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24501&action=edit Bug 11329: Check for marc record in opac-showmarc Instead of just running as_formatted, check if GetMarcBiblio returned a reference. If you e.g. did not pass an id, return 404 instead of 500. Consistent with opac-export.pl Test plan: [1] Run opac-showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |kyle@bywatersolutions.com --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- I think it would be less confusing for end-users if we had a "no record found" error instead of a generic 404, but this works. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24418|0 |1 is obsolete| | --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24502 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24502&action=edit Bug 11329: Check for marc record in catalogue/showmarc Intranet counterpart patch. Same check as in opac/opac-showmarc. Test plan: [1] Run showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Passes koha-qa.pl, works as advertised. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #12 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Marcel! Note bug 11581. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #13 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Patches pushed to 3.14.x, will be in 3.14.5 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11329 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #14 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.12.x will be in 3.12.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org