Bug 22052: Refactor DeleteExpiredOpacReigstrations
authorNick Clemens <nick@bywatersolutions.com>
Fri, 28 Dec 2018 18:48:25 +0000 (18:48 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 16 Jan 2019 08:32:36 +0000 (09:32 +0100)
commit992b3cbc29a1b215bae7a62d1c8c52da192a203c
tree27c8df0237605d8034b1c545f16ea3b69870332c
parentc31f7f6aa83ce6ce3f44f3a4a14762c644e5bb10
Bug 22052: Refactor DeleteExpiredOpacReigstrations

This patch changes the sub to use Koha::Objects and updates the tests.
Previously the sub would die on borrowers with checkouts and would
delete borrowers if they had fines

To test:
 1 - prove -v t/db_dependent/
 2 - Set your selfreg preferences:
    PatronSelfRegistration: Allow
    PatronSelfRegistrationDefaultCategory: SELFREG (or of your choice)
    PatronSelfRegistrationExpireTemporaryAccountsDelay: 30
 3 - Register a patron into SELFREG or how you set above
 4 - Set their date enrolled to two months ago
 5 - Checkout an item to the patron
 6 - Issue a fine to that patron
 7 - perl misc/cronjobs/cleanup_database.pl --del-exp-selfreg -v
 8 - The job should die with an error
 9 - Check in the item
10 - run the corn again - patron is deleted, oops
11 - Apply patch
12 - Create another patron in the same way
13 - Checkout and fine the patron
14 - run the cron
15 - they are not deleted, and no error
16 - checkin the item
17 - run the cron
18 - they are not deleted and no error
19 - clear the fine
20 - run the cron
21 - patron is deleted, huzzah

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b32756a5d7819e13290c2a145f3f0009280785c4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8102f6dc70623786c3247e008a0601cfd234d1e6)

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
(cherry picked from commit d95301763e8017d0db18cfd142e2227cbaafaf0c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Members.pm