Bug 12995 - script update_totalissues.pl stops on corrupted record
authorAdmin User Koha <koha@localhost>
Mon, 20 Oct 2014 13:07:29 +0000 (15:07 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 31 Oct 2014 17:14:24 +0000 (14:14 -0300)
commitccf406132424a2213aa5668c9efe3867aebe3e42
treea01ac42648c546436e83d14a7178f63b39d6ea51
parent65e0fba94b8e0f16de20214f6f2c89c2327fb3d0
Bug 12995 - script update_totalissues.pl stops on corrupted record

When running update_totalissues.pl cronjob, it will stop on a corrupted
record.

This patch changes UpdateTotalIssues so that it return 1 if processing
record has succeded. Also, if mapping with biblioitems.totalissues does
not exist, the method has nothing to do so it stops and returns 1.

When processing a corrupted record, script now alerts about the error on
this biblionumber (if script is verbose) and process next record.
A total number of records with error will be printed at the end of the
script.

Test plan :
- Create a dabase with a few biblios and some issues
- Modify first biblio record (use direct sql update) : set empty value
  in biblioitems.marcxml
- Launch script : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v

=> Without patch : the script stops at first record
=> With patch : the script prints error for first record and processes
   all records

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I was able to confirm the problem before the patch and successfully
follow the test plan.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
C4/Biblio.pm
misc/cronjobs/update_totalissues.pl