Koha/tools
Julian Maurice 675c8263b7
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>
2024-05-03 16:02:44 +02:00
..
csv-profiles
access_files.pl
additional-contents.pl
ajax-inventory.pl
automatic_item_modification_by_age.pl Bug 36634: Replace cud-show with show in tools/automatic_item_modification_by_age.pl 2024-04-19 18:06:38 +02:00
batch_delete_records.pl Bug 27893: Optionally skip biblio with open orders in batch delete 2024-04-19 18:06:32 +02:00
batch_extend_due_dates.pl
batch_record_modification.pl
batch_records_ajax.pl
batchMod.pl Bug 36326: Fix batch item mod/del access from biblio detail page 2024-03-22 12:26:36 +01:00
cleanborrowers.pl Bug 36526: Remove circular dependency from Koha::Objects 2024-05-03 16:02:44 +02:00
copy-holidays.pl
csv-profiles.pl
exceptionHolidays.pl
export.pl
holidays.pl
import_borrowers.pl Bug 34621: implement Patron import option to 'Renew existing patrons' 'from the current membership expiry date' 2024-04-12 14:02:41 +02:00
inventory.pl Bug 36305: (QA follow-up) Enforce op values in script 2024-03-15 09:38:55 +01:00
letter.pl Bug 33237: Add display of which language default language is expected 2024-04-30 14:32:14 +02:00
manage-marc-import.pl
marc_modification_templates.pl
modborrowers.pl Bug 36443: Add a fax field / column to the batch patron modification tool 2024-04-26 18:06:07 +02:00
newHolidays.pl
overduerules.pl
page.pl
picture-upload.pl
problem-reports.pl
quotes-upload.pl
quotes.pl
scheduler.pl
showdiffmarc.pl
stage-marc-import.pl
stockrotation.pl
tools-home.pl
upload-cover-image.pl
upload-file.pl
upload.pl
viewlog.pl Bug 35782: Replace TT plugin's method Biblio::HoldsCount 2024-03-15 09:38:39 +01:00