Bug 26235 - Allow to skip records when using bulkmarcimport.pl
Summary: Allow to skip records when using bulkmarcimport.pl
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Matthias Meusburger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-18 13:06 UTC by Matthias Meusburger
Modified: 2023-11-02 21:13 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
MT26327: Allow to skip records when using bulkmarcimport.pl (5.92 KB, patch)
2020-08-18 13:19 UTC, Matthias Meusburger
Details | Diff | Splinter Review
MT26327: Allow to skip records when using bulkmarcimport.pl (6.23 KB, patch)
2021-02-05 14:45 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 26235: Allow to skip records when using bulkmarcimport.pl (6.23 KB, patch)
2021-02-05 14:50 UTC, Matthias Meusburger
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Meusburger 2020-08-18 13:06:43 UTC
This patch allows to prevent records from being imported by bulkmarcimport.pl when a given value is present.
Comment 1 Matthias Meusburger 2020-08-18 13:19:51 UTC Comment hidden (obsolete)
Comment 2 Matthias Meusburger 2021-02-05 14:45:39 UTC Comment hidden (obsolete)
Comment 3 Matthias Meusburger 2021-02-05 14:46:05 UTC
This new patch adds log messages.
Comment 4 Matthias Meusburger 2021-02-05 14:50:58 UTC
Created attachment 116406 [details] [review]
Bug 26235: Allow to skip records when using bulkmarcimport.pl

This patch allows to prevent records from being imported by bulkmarcimport.pl
when a given value is present.

Two options are added:

 -incomingfilter: prevent the script from importing a record when a given value
                  is present in the record to be imported.

 -localfilter: prevent the script from importing a record when a given value is
               present in the koha record that would be replaced by the record
               to be imported.

They both accept the following specificaton:

'<FIELD>$<SUBFIELD>=<VALUE>'

Test plan:

 1) Apply this patch

 2) Launch bulkmarcimport.pl with the following option:
    -incomingfilter='152$b=rameau'

 3) Check that the incoming records with at least a 152$b equal to 'rameau' are
    skipped.
    The following message will be displayed for each skipped record if debug
    is enabled: Discarding record (incoming record contains 152$b = rameau)

 4) Repeat step 2 with localfilter: -localfilter='152$b=rameau'
    Check that incoming records are skipped when the koha record they would
    replace contains at least a 152$b equal to 'rameau'.

 5) Launch bulkmarcimport.pl with an invalid configuration, like:
    -incomingfilter='incorrect_specification' or
    -localfilter='incorrect_specification'

 6) Check that an error message is displayed and that the script exits.
Comment 5 Matthias Meusburger 2021-02-05 14:51:43 UTC
This patch fixes Bug number in commit message, sorry about that.