Bug 32174

Summary: bulkmarcimport.pl ignore items info when using -update
Product: Koha Reporter: Pablo AB <pablo.bianchi>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: robin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Pablo AB 2022-11-10 21:59:00 UTC
Using this command:

/usr/share/koha/bin/migration_tools/bulkmarcimport.pl 
  -v 
  -insert 
  -biblios 
  -framework "BKS" 
  -file /home/me/books.mrc 
  -l /tmp/books.log

works fine. If changes are made (on normal fields and on 952) on MRC and then we run:

/usr/share/koha/bin/migration_tools/bulkmarcimport.pl 
  -v 
  -match Control-number,001 
  -update 
  -biblios 
  -framework "BKS" 
  -file /home/me/books.mrc 
  -l /tmp/books.log

the information is update/overwritten, but *only at biblio level*. Item info remains untouched.

The solution maybe could be to add a --add-items-if-match option. To include -all option and have consistency with web interface --add-items-if-nomatch and --add-items-always could be added.
Comment 1 Katrin Fischer 2022-11-13 22:41:49 UTC
Hi Pablo, there are scripts that mimick the staged import that are probably better suited for this task: stage_file.pl and commit_file.pl

To my knowledge matching/updating items was not developed for bulkmarcimport.pl yet, which would make this an enhancement.
Comment 2 Pablo AB 2023-03-16 16:54:30 UTC
Thanks Katrin! Being 952 field part of the imported records, users might think that, by default, bulkmarcimport will update the whole record. In this scenario (mismatch between what's expected and what happen) could be considered a bug.

Would be nice at least a warning (perldoc on script and on the manual).