Bug 12289 - stage_file.pl does not allow control of nomatch options
Summary: stage_file.pl does not allow control of nomatch options
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-19 13:24 UTC by Martin Renvoize
Modified: 2017-06-14 22:05 UTC (History)
4 users (show)

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


Attachments
Bug 12289: Add nomatch options to stage_file.pl (1.95 KB, patch)
2014-05-19 13:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 12289: (follow-up) fix the compilation error (626 bytes, patch)
2015-09-01 07:27 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 12289: Add --no-create options to stage_file.pl (2.19 KB, patch)
2015-12-23 22:56 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 12289: (follow-up) fix the compilation error (680 bytes, patch)
2015-12-23 22:56 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 12289: Add --no-create options to stage_file.pl (2.27 KB, patch)
2015-12-26 11:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12289: (follow-up) fix the compilation error (754 bytes, patch)
2015-12-26 11:47 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2014-05-19 13:24:26 UTC
The SetImportBatchNoMatchAction options are hard coded in this script, they should be operators.
Comment 1 Martin Renvoize 2014-05-19 13:24:56 UTC Comment hidden (obsolete)
Comment 2 Martin Renvoize 2014-05-19 13:26:22 UTC
This patch adds a control operator to allow for the setting of 'ignore' in  SetImportBatchNoMatchAction.

To test, call the script with --no-create and your will find that new records are not created when no match is found.  The default, of create_new remains the same as before.
Comment 3 Joonas Kylmälä 2015-09-01 07:25:03 UTC
I get this error when running the script after the patch:

Global symbol "$no_create" requires explicit package name at ./misc/stage_file.pl line 57.
Global symbol "$no_create" requires explicit package name at ./misc/stage_file.pl line 123.
Execution of ./misc/stage_file.pl aborted due to compilation errors.
Comment 4 Joonas Kylmälä 2015-09-01 07:27:37 UTC Comment hidden (obsolete)
Comment 5 Joonas Kylmälä 2015-09-01 07:29:21 UTC
Now it looks to me that this is working as it should. Someone, sign-off this please! :)
Comment 6 Chris Cormack 2015-12-23 22:56:05 UTC Comment hidden (obsolete)
Comment 7 Chris Cormack 2015-12-23 22:56:19 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-12-26 11:47:26 UTC
Created attachment 45985 [details] [review]
Bug 12289: Add --no-create options to stage_file.pl

This patch adds the no-create options to the command line interface
for bulk loading of records.

To test
1/ Apply both patches
2/ Call the script with --no-create and your will find that new
records are not created when no match is found.  The default, of
create_new remains the same as before.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2015-12-26 11:47:30 UTC
Created attachment 45986 [details] [review]
Bug 12289: (follow-up) fix the compilation error

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Brendan Gallagher 2015-12-30 21:35:14 UTC
pushed to master - thanks