Bug 6747

Summary: Additional check in opac-export
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: OPACAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: minor    
Priority: PATCH-Sent (DO NOT USE) CC: chris, koha.sekjal
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Patch
Revised patch
Signed-off patch

Description Marcel de Rooy 2011-08-18 10:41:15 UTC
If GetMarcBiblio function returns undef, the opac-export script does not handle it properly.
Trivial patch sent.
Comment 1 Marcel de Rooy 2011-08-18 10:44:31 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2011-08-18 10:49:44 UTC
Simple test: 
Run <yourserver>/cgi-bin/koha/opac-export.pl?format=utf8&op=export&bib=99999999 with the bib number not existing in your db (without this patch). 
You will get a 500 error.
Apply the patch and do it again.
Do you get the error message Record not found in your browser now?
Comment 3 Owen Leonard 2011-08-18 14:40:27 UTC
It's hard to imagine how this might happen in the real world, but all error-checking is a good thing. What I'm wondering is whether we should redirect to the 404 page instead of sending a plain error page?
Comment 4 Marcel de Rooy 2011-08-22 12:24:37 UTC
(In reply to comment #3)
> It's hard to imagine how this might happen in the real world, but all
> error-checking is a good thing. What I'm wondering is whether we should
> redirect to the 404 page instead of sending a plain error page?

Found several 500 errors on deleted records; they are generated by Googlebot. 

Sending revised patch with 404 and some additional revisions now. While testing, I noticed that formats ris and endnote did not generate something useful. But that is not the point of this report..
Comment 5 Marcel de Rooy 2011-08-22 12:25:46 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2011-08-24 16:31:30 UTC
Created attachment 5120 [details] [review]
Signed-off patch

Thanks for making that change. I think it's more consistent to use the existing 404 error.
Comment 7 Ian Walls 2011-08-25 17:26:20 UTC
Mostly spacing changes, with some default values added to potentially undefined values.  Marking as Passed QA.
Comment 8 Chris Cormack 2011-08-26 19:18:33 UTC
Pushed to master, please test
Comment 9 Chris Nighswonger 2011-10-26 18:02:27 UTC
The fix for this bug was published in the 3.4.5 release. If you were the reporter of this bug, please take time to verify the fix and update the status of this bug report accordingly. If the bug is fixed to your satisfaction, please close this report.