Bug 8818

Summary: Authority linker error on Z cataloging
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: CatalogingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact: Mason James <mtj>
Severity: blocker    
Priority: P1 - high CC: chris, jcamins, m.de.rooy, mtj, paul.poulain
Version: 3.10   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8829
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 8818: make sure we load modules before using them
[SIGNED-OFF] Bug 8818: make sure we load modules before using them

Description Nicole C. Engard 2012-09-25 14:05:21 UTC
I was cataloging a new book today. I followed these steps:

1. Z39 search of LOC
2. Choose title
3. Add summary 520
4. Add url 856
5. Choose authority for author 100
6. Hit save

I got this error:

Software error:

Can't locate object method "new" via package "C4::Linker::FirstMatch" (perhaps you forgot to load "C4::Linker::FirstMatch"?) at /home/nengard/kohaclone/C4/Biblio.pm line 503.

For help, please send mail to the webmaster (webmaster@debian), giving this error message and the time and date of the error.
Comment 1 Nicole C. Engard 2012-09-25 14:07:29 UTC
I tried again skipping steps 3-5 and still get the same error.
Comment 2 Nicole C. Engard 2012-09-25 14:09:12 UTC
Finally I changed my linker settings and just got a different error:

Software error:

Can't locate object method "new" via package "C4::Linker::Default" (perhaps you forgot to load "C4::Linker::Default"?) at /home/nengard/kohaclone/C4/Biblio.pm line 503.

For help, please send mail to the webmaster (webmaster@debian), giving this error message and the time and date of the error.
Comment 3 Jared Camins-Esakov 2012-09-25 23:41:09 UTC Comment hidden (obsolete)
Comment 4 Nicole C. Engard 2012-09-26 00:29:42 UTC
Created attachment 12512 [details] [review]
[SIGNED-OFF] Bug 8818: make sure we load modules before using them

An eval { eval "require $module;" }; was replaced with
eval { eval { require $module; }; }; which is a no-op, meaning that
the linker was not getting loaded, and the catalog module was throwing
up a big nasty error every time someone tried to save a record with a
heading. This patch replaces the require with can_load from
Module::Load::Conditional, which is PBP-friendly, and offers equivalent
functionality.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Comment 5 Mason James 2012-09-30 23:31:41 UTC
(In reply to comment #4)
> Created attachment 12512 [details] [review]
> [SIGNED-OFF] Bug 8818: make sure we load modules before using them
 
patch looks good, passing QA

$ koha-qa.pl  -c 1 

testing 1 commit(s) (applied to commit eb6effd)
 * 0a60190 Bug 8818: make sure we load modules before using them
      C4/Biblio.pm
      misc/link_bibs_to_authorities.pl

* C4/Biblio.pm                                                             OK
* misc/link_bibs_to_authorities.pl                                         OK
Comment 6 Nicole C. Engard 2012-10-01 14:05:05 UTC
updating severity since I can't catalog at all until this is pushed.
Comment 7 Paul Poulain 2012-10-01 17:10:40 UTC
Patch pushed to master
Comment 8 Chris Cormack 2013-04-20 23:13:16 UTC
Released in 3.10.0