Koha-clms/misc
Ayoub Glizi-Vicioso 0c2ef0e6b4
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>
2026-04-16 15:54:07 -06:00
..
admin Bug 40545: (follow-up) Correct GNU link 2025-10-15 16:12:02 -06:00
bin Bug 37538: Improve documentation for the OCLC import daemon script 2026-01-12 10:53:30 -07:00
cronjobs Bug 41967: Ensure --cards argument accepts an integer in cleanup_database.pl 2026-04-16 15:54:07 -06:00
devel Bug 38365: Add context to Koha::Devel::Files in add_csp_nonces.pl 2026-03-16 11:57:41 +01:00
interface_customization
…
maintenance Bug 41097: (QA follow-up) Clarify POD 2026-02-25 07:37:04 -07:00
migration_tools Bug 28528: (QA follow-up) Remove "Koha 3" reference 2026-02-26 09:04:10 -07:00
release_notes 25.11.00: Add release notes 2025-12-05 13:31:40 -07:00
search_tools Bug 40722: Add a log when resetting mappings during elastic rebuild 2025-10-15 16:12:07 -06:00
translator Bug 41216: (QA follow-up): fix path of xt/author/tt_valid.t in comment 2026-04-10 09:48:11 -06:00
workers Bug 40820: (follow-up) es_indexer_daemon.pl missed on 34070 2025-09-26 10:36:58 -06:00
add_date_fields_to_marc_records.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06: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 2025-09-23 16:21:29 -06: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 2025-09-23 16:21:29 -06:00
export_records.pl Bug 41494: Rename "Koha administration" module name to "Administration" 2026-01-06 07:45:37 -07:00
import_patrons.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
koha-install-log
…
link_bibs_to_authorities.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
load_yaml.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
mod_zebraqueue.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
process_ill_updates.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
recreateIssueStatistics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06: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 2025-09-23 16:21:29 -06:00
stage_file.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
z3950_responder.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00