Koha/tools
Julian Maurice aace5d0990 Bug 36526: Remove circular dependency from Koha::Objects
Koha::Objects depends on Koha::DateUtils, which depends on C4::Context,
which depends on Koha::Config::SysPrefs, which depends on Koha::Objects

Apart from the circular dependency, the dependency on C4::Context alone
is problematic as it loads a bunch of modules that are not needed at all
in Koha::Objects (YAML::XS and ZOOM for instance).
As Koha::Objects is used as a base for a lot of modules, we should take
care to only load the minimum required.

This patch removes uses of Koha::DateUtils from Koha::Objects.
It was only used in Koha::Objects::filter_by_last_update

filter_by_last_update now requires that the 'from' and 'to' parameters
must be DateTime objects. Previously it would also allow date and
datetime strings. This possibility was only used in two places:
* misc/cronjobs/cleanup_database.pl
* tools/cleanborrowers.pl

Now they call dt_from_string first and pass a DateTime object to
filter_by_last_update

Test plan:
1. Run `perl -cw Koha/Objects.pm`. It should only say:
   "Koha/Objects.pm syntax OK" without warnings
2. Run `prove t/db_dependent/Koha/Objects.t`
3. Verify that misc/cronjobs/cleanup_database.pl works as before,
   especially with the options --pseudo-transactions,
   --pseudo-transactions-from and --pseudo-transactions-to
4. Go to Tools » Batch patron deletion and anonymization, check "Verify
   you want to anonymize patron checkout history" and enter a date in
   the text input below. Then click Next and verify that the correct
   count of borrowers is shown. Click on the "Finish" button and verify
   that the circulation history has been correctly anonymized

See also bug 36432

Signed-off-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 675c8263b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-05-24 14:59:19 +02:00
..
csv-profiles
access_files.pl
additional-contents.pl Bug 31383: (QA follow-up) Tidy 2023-10-20 14:44:03 -03:00
ajax-inventory.pl
automatic_item_modification_by_age.pl Bug 32029: Automatic item modifications by age add biblio table 2024-03-11 11:16:47 +01:00
batch_delete_records.pl
batch_extend_due_dates.pl Bug 26978: Add item type option to batch extend due date tool 2023-10-11 12:13:03 -03:00
batch_record_modification.pl
batch_records_ajax.pl Bug 34913: Adjust "Manage staged MARC records" 2024-01-29 10:15:53 +01:00
batchMod.pl Bug 34257: (QA follow-up): tidy up code 2023-09-12 09:45:05 -03:00
cleanborrowers.pl Bug 36526: Remove circular dependency from Koha::Objects 2024-05-24 14:59:19 +02:00
copy-holidays.pl
csv-profiles.pl
exceptionHolidays.pl Bug 33667: Allow copying holidays to all libraries when editing 2023-07-06 10:08:45 -03:00
export.pl
holidays.pl
import_borrowers.pl Bug 34621: implement Patron import option to 'Renew existing patrons' 'from the current membership expiry date' 2024-05-23 14:56:02 +02:00
inventory.pl Bug 35641: Reduce DB lookups when sending a list of barcodes to inventory 2024-01-17 10:43:36 +01:00
letter.pl Bug 36652: Pass copy_form template variable 2024-05-23 17:01:26 +02:00
manage-marc-import.pl
marc_modification_templates.pl
modborrowers.pl Bug 35817: Fix hint on patron's category when batch update patron 2024-01-31 14:38:01 +01:00
newHolidays.pl
overduerules.pl
page.pl Bug 31383: Create a parent-child DB relation for additional content 2023-10-20 14:43:56 -03:00
picture-upload.pl
problem-reports.pl
quotes-upload.pl
quotes.pl
scheduler.pl Bug 34349: Validate/escape inputs for task scheduler 2023-09-25 18:18:38 -03:00
showdiffmarc.pl
stage-marc-import.pl Bug 33755: Set profile_id and add missing import 2023-08-15 12:16:59 +03:00
stockrotation.pl Bug 34773: Improve translation of title tags: Cataloging tools 2023-11-06 08:42:44 -03:00
tools-home.pl Bug 33595: (bug 26628 follow-up) Fix authorization for tools-home.pl 2023-05-16 11:47:15 +02:00
upload-cover-image.pl Bug 35291: (QA follow-up) Tidying script for QA test tools 2023-11-24 16:43:25 -03:00
upload-file.pl
upload.pl
viewlog.pl