https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41967
Bug ID: 41967
Summary: Cleanup database --labels deletes labels over 1 day
old regardless of passed value
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Command-line Utilities
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
A client noticed that their label batches were always deleted, even though our
serverwide cron says to delete label batches over 30 days old.
I noticed it does the same on main.
To test you have to manipulate data a little bit :
1. Create two label batches
1.1. Go to Cataloging > Label creator > New > Label batch
1.2. Add barcodes in "Add by barcodes or itemnumbers"
If using KTD, you can use the following barcodes
39999000010114
39999000010138
39999000010152
1.3. Click "Add items"
1.4. Redo steps 1.1 to 1.3 for the second batch (it can have the same
barcodes, it doesn't really matter)
2. Manipulate the timestamps in the DB so that they are ~30 days ago and ~5
days ago
* If using KTD access the database with `ktd --dbshell` (if outside the shell)
or `koha-mysql kohadev` (if already inside the shell)
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';
* If necessary, change the label batch ids. If using a fresh KTD, the batches
should be 1 and 2.
==> You should have 6 entries in creator_batches, 3 with a timestamp 30 days
ago and 3 with a timestamp 5 days ago.
3. Run cleanup_database with --labels set to 15 days and verbose option (and
confirm option)
==> The output says "Purging item label batches last added to more than 1 days
ago.
Done with purging 6 item label batches last added to more than 1 days ago."
==> Nothing left in creator_batches even though one set was less than 15 days
old. :(
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/