Bug 11417

Summary: remove_unused_authorities.pl doesn't accept --test
Product: Koha Reporter: Gaetan Boisson <gaetan.boisson>
Component: Command-line UtilitiesAssignee: Gaetan Boisson <gaetan.boisson>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: fridolin.somers, gmcharlt, tomascohen
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 11417 - remove_unused_authorities.pl doesn't accept --test
Bug 11417: make sure remove_unused_authorities.pl accepts --test
Bug 11417: make sure remove_unused_authorities.pl accepts --test

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!