Summary: | bulkmarcimport.pl allows -b and -a to be specified simultaneously | ||
---|---|---|---|
Product: | Koha | Reporter: | Galen Charlton <gmcharlt> |
Component: | MARC Bibliographic data support | Assignee: | Magnus Enger <magnus> |
Status: | CLOSED FIXED | QA Contact: | Bugs List <koha-bugs> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, julian.maurice, kyle, mtompset, tomascohen |
Version: | Main | ||
Hardware: | PC | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 4126 - Exit bulkmarcimport if -a and -b given
[SIGNED-OFF] Bug 4126 - Exit bulkmarcimport if -a and -b given Bug 4126 - Exit bulkmarcimport if -a and -b given |
Description
Chris Cormack
2010-05-21 01:23:26 UTC
I haven't checked the exact situation reported, but it looks like the somultaneous authorities + biblios switches are not handled correctly, by code like this: if ($delete) { if ($biblios){ print "deleting biblios\n"; $dbh->do("truncate biblio"); $dbh->do("truncate biblioitems"); $dbh->do("truncate items"); } else { print "deleting authorities\n"; $dbh->do("truncate auth_header"); } $dbh->do("truncate zebraqueue"); } Which should truncate both if present, not just biblios. Regards To+ Created attachment 57428 [details] [review] Bug 4126 - Exit bulkmarcimport if -a and -b given Currently it is possible to spceify both --biblios and --authorities as command line switches to bulkmarcimport.pl. This does not make sense so we should exit early and explain that these switches are mutually exclusive. To test: - Run one of these and check that there is no complaint about missing options: perl misc/migration_tools/bulkmarcimport.pl -a -b sudo koha-shell -c "perl misc/migration_tools/bulkmarcimport.pl -a -b" kohadev - Observe that this displays the perldoc, but does not complain about mutually exclusive switches. - Apply the patch - Rerun the command(s) from earlier. - Verify that the script is now halted and a small explanation given. Created attachment 58833 [details] [review] [SIGNED-OFF] Bug 4126 - Exit bulkmarcimport if -a and -b given Currently it is possible to spceify both --biblios and --authorities as command line switches to bulkmarcimport.pl. This does not make sense so we should exit early and explain that these switches are mutually exclusive. To test: - Run one of these and check that there is no complaint about missing options: perl misc/migration_tools/bulkmarcimport.pl -a -b sudo koha-shell -c "perl misc/migration_tools/bulkmarcimport.pl -a -b" kohadev - Observe that this displays the perldoc, but does not complain about mutually exclusive switches. - Apply the patch - Rerun the command(s) from earlier. - Verify that the script is now halted and a small explanation given. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Should not we also add the same exit if none are given instead of assuming it's biblio? I can provide a patch if you agree with that. (In reply to Jonathan Druart from comment #4) > Should not we also add the same exit if none are given instead of assuming > it's biblio? > > I can provide a patch if you agree with that. While I agree that for clarity sake forcing people to specify is good, that seems to be a problem beyond the scope of this bug. Also, one has to consider: do you really want to have to type an extra 3 characters to run the command when, for the most part, it will likely be biblios? I think the default behaviour is adequate and see no reason to change it, unless there is going to be a sweeping "we must be explicit about everything" in all the parameters for all scripts. I vote for keeping it moving on to Pass QA. :) Created attachment 59618 [details] [review] Bug 4126 - Exit bulkmarcimport if -a and -b given Currently it is possible to spceify both --biblios and --authorities as command line switches to bulkmarcimport.pl. This does not make sense so we should exit early and explain that these switches are mutually exclusive. To test: - Run one of these and check that there is no complaint about missing options: perl misc/migration_tools/bulkmarcimport.pl -a -b sudo koha-shell -c "perl misc/migration_tools/bulkmarcimport.pl -a -b" kohadev - Observe that this displays the perldoc, but does not complain about mutually exclusive switches. - Apply the patch - Rerun the command(s) from earlier. - Verify that the script is now halted and a small explanation given. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 17.05, thanks Magnus! This patch has been pushed to 16.11.x and will be in 16.11.04. Pushed to 3.22.x for 3.22.17 |