Bug 8674

Summary: Need a delete biblios script
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: CatalogingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: kyle, m.de.rooy, magnus, nengard, paul.poulain, stephane.delaye
Version: 3.10   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 8149    
Attachments: Bug 8438: Adds script batchdeletebiblios
Bug 8674: Adds script batchdeletebiblios
Bug 8674: Followup: Add POD for misc/batchdeletebiblios.pl
Bug 8674: Adds script batchdeletebiblios
Bug 8674: Followup: Add POD for misc/batchdeletebiblios.pl
Bug 8674 follow-up Fix perlcritic error

Description Jonathan Druart 2012-08-23 12:26:05 UTC
We need a script to delete biblios
Comment 1 Jonathan Druart 2012-08-23 12:30:24 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2012-08-23 12:31:53 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2012-08-29 14:01:38 UTC
I realize that we don't really have firm coding guidelines for command line scripts (http://wiki.koha-community.org/wiki/Coding_Guidelines#Command-line_argument_conventions sounds preliminary), but I'm inclined to not sign off on this script because it offers no help to the user. Running it with no arguments doesn't give me feedback about specifying a file, and running it with "--help" returns no help.

Other than that the script seems to be working as expected. Records with items are not deleted, records without items are deleted and added to oldbiblio.

I wonder if it would be useful to show a different message if a biblionumber is not found? Re-running the script on a file of already-deleted records returns "OK" for each.
Comment 4 Jonathan Druart 2012-08-30 08:41:49 UTC Comment hidden (obsolete)
Comment 5 delaye 2012-08-31 11:40:02 UTC
i test in a sandbox . it's ok

perl batchdeletebiblios.pl file name

or

perl batchdeletebiblios.pl /home/directory_name/file_name
Comment 6 Kyle M Hall 2012-08-31 14:44:23 UTC
Created attachment 11919 [details] [review]
Bug 8674: Adds script batchdeletebiblios

This script batch deletes biblios which contain a biblionumber
present in file passed in parameter.
If one biblio has items, it is not deleted.

http://bugs.koha-community.org/show_bug.cgi?id=8674

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Created file with biblionumbers for bibs with and without items.
Only the bibs without items were deleted.
Comment 7 Kyle M Hall 2012-08-31 14:44:33 UTC
Created attachment 11920 [details] [review]
Bug 8674: Followup: Add POD for misc/batchdeletebiblios.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Kyle M Hall 2012-08-31 14:47:01 UTC
I should note that I did test the help, it displays when the script is run with no arguments, or when -h or --help is passed.

(In reply to comment #7)
> Created attachment 11920 [details] [review]
> Bug 8674: Followup: Add POD for misc/batchdeletebiblios.pl
> 
> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Paul Poulain 2012-10-02 15:48:55 UTC
QA comment:
 * 0 side effect risk: new script in misc
 * script located at same place as many other batchsomething, so it's OK
 * passes koha-qa.pl after a tiny follow-up for perlcritic ( file opening was not perlcritic compliant)

passed QA
Comment 10 Paul Poulain 2012-10-02 15:49:08 UTC
Created attachment 12647 [details] [review]
Bug 8674 follow-up Fix perlcritic error