Bug 12289

Summary: stage_file.pl does not allow control of nomatch options
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Command-line UtilitiesAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brendan, jonathan.druart, joonas.kylmala, katrin.fischer
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:
Attachments: Bug 12289: Add nomatch options to stage_file.pl
Bug 12289: (follow-up) fix the compilation error
Bug 12289: Add --no-create options to stage_file.pl
Bug 12289: (follow-up) fix the compilation error
Bug 12289: Add --no-create options to stage_file.pl
Bug 12289: (follow-up) fix the compilation error

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