Bug 23933

Summary: commit_file.pl Can't call method "get_effective_marcorgcode" on an undefined value at /usr/share/koha/lib/C4/AuthoritiesMarc.pm line 578.
Product: Koha Reporter: Hugo Agud <hagud>
Component: Command-line UtilitiesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, m.de.rooy, martin.renvoize, robin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.05
Bug Depends on: 10132    
Bug Blocks:    
Attachments: Bug 23933: (bug 10132 follow-up) Fix commit_file.pl
Bug 23933: (bug 10132 follow-up) Fix commit_file.pl
Bug 23933: (bug 10132 follow-up) Fix commit_file.pl

Description Hugo Agud 2019-10-31 11:46:50 UTC
When trying to commit records via command line using commit_file.pl in combination with syspref  AutoCreateAuthorities 'generate' and  BiblioAddsAuthorities  ' allow'

if marcrecods has not 003 the system stops with error:
Can't call method "get_effective_marcorgcode" on an undefined value at /usr/share/koha/lib/C4/AuthoritiesMarc.pm line 578.

It also happened with cataloguing form at admin gui, but I am not able to reproduce the error again.
Comment 1 Jonathan Druart 2019-11-04 11:23:54 UTC
Caused by my follow-up on bug 10132:
  commit 80c749df80f08be46b895715045b38cd1ded2ed1
  Bug 10132: Simplify code, call the method only once
Comment 2 Jonathan Druart 2019-11-04 11:26:33 UTC
Created attachment 94999 [details] [review]
Bug 23933: (bug 10132 follow-up) Fix commit_file.pl
Comment 3 Martin Renvoize 2019-11-04 17:29:56 UTC
Created attachment 95026 [details] [review]
Bug 23933: (bug 10132 follow-up) Fix commit_file.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2019-11-04 17:30:41 UTC
Fix works, Signingoff..

Wondering about Unit tests, but will leave that for QA discretion.
Comment 5 Marcel de Rooy 2019-11-08 10:22:51 UTC
Created attachment 95190 [details] [review]
Bug 23933: (bug 10132 follow-up) Fix commit_file.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Martin Renvoize 2019-11-08 12:57:03 UTC
Nice work!

Pushed to master for 19.11.00
Comment 7 Fridolin Somers 2019-11-15 10:19:17 UTC
Pushed to 19.05.x for 19.05.05