Bug 11417 - remove_unused_authorities.pl doesn't accept --test
Summary: remove_unused_authorities.pl doesn't accept --test
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Gaetan Boisson
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 14:02 UTC by Gaetan Boisson
Modified: 2015-06-04 23:23 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11417 - remove_unused_authorities.pl doesn't accept --test (2.12 KB, patch)
2013-12-18 14:30 UTC, Gaetan Boisson
Details | Diff | Splinter Review
Bug 11417: make sure remove_unused_authorities.pl accepts --test (2.17 KB, patch)
2013-12-18 23:26 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 11417: make sure remove_unused_authorities.pl accepts --test (2.24 KB, patch)
2013-12-19 09:51 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 Gaetan Boisson 2013-12-18 14:02:11 UTC
remove_unused_authorities.pl says in the help that it will accept both --test and --t as arguments in order to only test and count eligible authorities without removing them :

This script will parse all authoritiestypes given as parameter, and remove authorities without any biblio attached.
warning : there is no individual confirmation !
parameters
    --aut|authtypecode TYPE       the list of authtypes to check
    --t|test                      test mode, don't delete really, just count
    --help or -h                  show this message.


 but in practice it only accepts --t :

GetOptions(
    'aut|authtypecode:s'    => \@authtypes,
    't'    => \$test,
    'h|help'        => \$want_help
);

A user launching the script with --test will see a warning that there was an unrecognised option, and the authorities will be deleted
Comment 1 Gaetan Boisson 2013-12-18 14:30:47 UTC Comment hidden (obsolete)
Comment 2 Galen Charlton 2013-12-18 23:26:54 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2013-12-19 09:51:54 UTC
Created attachment 23667 [details] [review]
Bug 11417: make sure remove_unused_authorities.pl accepts --test

This patches adds support for the --test option, as well as a
short message telling the user the script is running in test mode.

Test plan :
- Launch the script with -h to see the help
- Launch the script with --test and --aut with an authtypecode
  that is used in your instance
- Make sure it does the same thing as launching it with -t
- Launch the script for real and make sure it still works as
  expected, deleting unused authorities.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Galen Charlton 2013-12-19 15:09:43 UTC
Pushed to master.  Thanks, Gaetan!
Comment 5 Fridolin SOMERS 2014-01-27 12:42:41 UTC
Patch pushed to 3.14.x, will be in 3.14.3.
Comment 6 Tomás Cohen Arazi 2014-02-07 17:12:14 UTC
This patch has been pushed to 3.12.x, will be in 3.12.11.

Thanks Gaetan! This is an important fix!