[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
Mon Dec 28 16:49:37 CET 2015


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

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #44963|0                           |1
        is obsolete|                            |

--- Comment #2 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 46007
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46007&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>

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


More information about the Koha-bugs mailing list