Bug 8674 - Need a delete biblios script
Summary: Need a delete biblios script
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 8149
  Show dependency treegraph
 
Reported: 2012-08-23 12:26 UTC by Jonathan Druart
Modified: 2013-05-23 06:23 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8438: Adds script batchdeletebiblios (2.39 KB, patch)
2012-08-23 12:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8674: Adds script batchdeletebiblios (2.39 KB, patch)
2012-08-23 12:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8674: Followup: Add POD for misc/batchdeletebiblios.pl (3.04 KB, patch)
2012-08-30 08:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8674: Adds script batchdeletebiblios (2.60 KB, patch)
2012-08-31 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 8674: Followup: Add POD for misc/batchdeletebiblios.pl (3.14 KB, patch)
2012-08-31 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 8674 follow-up Fix perlcritic error (929 bytes, patch)
2012-10-02 15:49 UTC, Paul Poulain
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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