Koha-clms/misc
Ayoub Glizi-Vicioso 129cc9054b
Bug 41967: Ensure --cards argument accepts an integer in cleanup_database.pl
Test plan (for --cards arguments) :

1. Initial Setup:
    a) Go to Tools > Patron card creator > New > Card batch
    b) Create two different batches (Batch 1 and Batch 2) using the 'Add by borrowernumber(s):' option.
        If using **KTD** you can use the following borrowernumbers for both batches:
            15
            29
            47
        else you will need to create your own patrons and enter their borrowernumber.
    c) In your terminal, set the timestamps manually:
        --OPTION A (KTD users):
            ktd --shell
            koha-mysql kohadev

        --OPTION B:
            Access your database

        Then:
            UPDATE creator_batches SET timestamp = DATE_SUB(NOW(), INTERVAL 30 DAY) WHERE batch_id = '1';
            UPDATE creator_batches SET timestamp = DATE_SUB(NOW(), INTERVAL 5 DAY) WHERE batch_id = '2';

    Note: your batch_id may differ.

2. Before Applying the Patch:
    a) Run the following cleanup script:
        ./misc/cronjobs/cleanup_database.pl --cards 15 --confirm --verbose
    b) Error in console output
    c) Nothing is deleted even though one batch was older than 15 days
        SELECT * FROM creator_batches;

3. Apply The Patch

4. After Applying The Patch:
    a) Redo step 1 (Initial Setup).
    b) Run again the following cleanup script:
        ./misc/cronjobs/cleanup_database.pl --cards 15 --confirm --verbose
    c) Check that the console output says: "Purging ... more than 15 days ago"
    d) Batch 1 is deleted, but Batch 2 (5 days old) is STILL PRESENT. Success!
        SELECT * FROM creator_batches;

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c2ef0e6b4)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2026-07-21 14:14:31 +12:00
..
admin Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
bin Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
cronjobs Bug 41967: Ensure --cards argument accepts an integer in cleanup_database.pl 2026-07-21 14:14:31 +12:00
devel Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
interface_customization Bug 23148: Replace Bridge icons with transparent PNG files 2020-07-20 16:16:37 +02:00
maintenance Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
migration_tools Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
release_notes Update release notes for 25.05.12 release 2026-07-09 11:53:31 +12:00
search_tools Bug 40722: Add a log when resetting mappings during elastic rebuild 2026-02-17 16:24:04 +00:00
translator Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
workers Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
add_date_fields_to_marc_records.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
add_statistics_borrowers_categorycode.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchCompareMARCvsFrameworks.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchDeleteUnusedSubfields.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
batchImportMARCWithBiblionumbers.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRebuildBiblioTables.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRebuildItemsTables.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRepairMissingBiblionumbers.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchdeletebiblios.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
check_sysprefs.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
commit_file.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
export_borrowers.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
export_records.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
import_patrons.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
koha-install-log Bug 28519: Put CGI::Session::Serialize::yamlxs in lib directory 2021-06-17 10:07:36 +02:00
link_bibs_to_authorities.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
load_yaml.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
mod_zebraqueue.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
process_ill_updates.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
recreateIssueStatistics.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
sax_parser_print.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
sax_parser_test.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
sip_cli_emulator.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
stage_file.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
z3950_responder.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00