Bug 10419: (follow-up) functional improvements
authorGalen Charlton <gmc@esilibrary.com>
Tue, 6 Aug 2013 15:38:24 +0000 (15:38 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 3 Oct 2013 21:42:03 +0000 (21:42 +0000)
commit86c73e9b40491e5a8782dfbefd647272c0a58297
tree8434a0d9eb5c2cc04801473916309ea8c8a1134c
parent2a9c129d31e47908c8208291321e2d3f51de9ee7
Bug 10419: (follow-up) functional improvements

[1] Patron deletion now happens atomically; if one part
    of the process fails, the record isn't left in a
    partially deleted state.
[2] The routine for handling lists properly during patron
    deletion is now invoked.
[3] The script now prints an indication if it's run
    without --confirm; otherwise, one might think that
    patron records were actually being deleted.
[4] --verbose now actually does something.

Without --verbose, the script will print the dry-run
warning (if applicable), the number of patrons to be
deleted, and error messages.

With --verbose, the script will also print a line with
the borrowernumber of each patron to be deleted.

To test:

[1] Run the script with and without --verbose and compare
    the, well, verbosity.
[2] Run the script without --confirm and note that the script
    prints a message saying that it's running in dry-run mode.
[3] Use the script to try to delete one or more patrons that have
    loans.  Confirm that error messages are printed reporting
    foreign constraints preventing the deletion.  Also confirm that
    no new rows are added to deletedborrowers for those patrons that
    could not be completely deleted.
[4] Use the script to delete a patron that has a public list.  Verify
    that after the deletion, the public list still exists but now
    has a null owner.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
misc/cronjobs/delete_patrons.pl