Summary: | Validate passed records in Biblio.pm | ||
---|---|---|---|
Product: | Koha | Reporter: | Colin Campbell <colin.campbell> |
Component: | MARC Bibliographic data support | Assignee: | Colin Campbell <colin.campbell> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | fridolin.somers, gmcharlt, kyle |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Proposed Patch
[SIGNED OFF] Bug 11032: Check a valid MARC::Record passed to Biblio Bug 11032: Check a valid MARC::Record passed to Biblio |
Description
Colin Campbell
2013-10-10 10:32:15 UTC
Created attachment 21958 [details] [review] Proposed Patch As these cases do not need to access db have added a Biblio.t which test error returns and logs messages to stderr, to run prove t/Biblio.t I'm happy to see that you're trying to address this problem. Can you please add a test plan to your commit message? (In reply to Owen Leonard from comment #2) > I'm happy to see that you're trying to address this problem. Can you please > add a test plan to your commit message? test plan is the tests added to t/Biblio.t see previous comment Created attachment 22447 [details] [review] [SIGNED OFF] Bug 11032: Check a valid MARC::Record passed to Biblio Intermittently problems in the calling environment cause a C4::Biblio to be called with and undefined MARC::Record object. This results in the process dieing and returning to the enduser a low level message such as 'cannot call method x on an undefined object' For exported subroutines taking a MARC::Record object check that object is defined otherwise return a logical return value and log a stack trace to the error log. A couple of cases were checking but dieing, this may have unwelcome results in a persistent environment so croak has been downgraded to carp Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Adds lots of checks for $record in various places, should not affect behaviour. Passed all tests and QA script, including new unit tests. Tested adding and saving a new record. Also tested detail and result pages without XSLT. Created attachment 22832 [details] [review] Bug 11032: Check a valid MARC::Record passed to Biblio Intermittently problems in the calling environment cause a C4::Biblio to be called with and undefined MARC::Record object. This results in the process dieing and returning to the enduser a low level message such as 'cannot call method x on an undefined object' For exported subroutines taking a MARC::Record object check that object is defined otherwise return a logical return value and log a stack trace to the error log. A couple of cases were checking but dieing, this may have unwelcome results in a persistent environment so croak has been downgraded to carp Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Adds lots of checks for $record in various places, should not affect behaviour. Passed all tests and QA script, including new unit tests. Tested adding and saving a new record. Also tested detail and result pages without XSLT. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master. Thanks, Colin! Patch pushed to 3.14.x, will be in 3.14.2. |