[Koha-bugs] [Bug 15209] C4::Koha routines expecting a MARC::Record object should check it is defined

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 8 18:34:09 CET 2016


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15209

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #46007|0                           |1
        is obsolete|                            |
  Attachment #46008|0                           |1
        is obsolete|                            |
  Attachment #46009|0                           |1
        is obsolete|                            |

--- Comment #5 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 46447
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46447&action=edit
Bug 15209 Validate passed MARC::Record objs in C4::Koha

Ensure that a passed MARC::Record is defined before calling
its methods. Otherwise you are open to occurences of the
error 'Can't call method "field" on an undefined value'
In a CGI environment you can live with such sloppiness but
in a persistent environment the error can cause the instance
to abort.
Made all routines passed a MARC::Record validate it before calling
its methods. Changed the parameter name from the meaningless
record to marcrecord to indicate its content. Added an explicit return
for all cases where no valid data returned. Cleaned up some logic for
clarity. I think we can assume that GetNormalizedOCLCNumber meant to
look at all 035s till it found an OCLC number not just the first.

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list