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 Bug 33341: Address some perlcritic errors in 5.36 2023-03-28 14:50:33 +02:00
additional-contents.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
ajax-inventory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
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 Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
batch_record_modification.pl Bug 34478: SQUASH Follow-up to previous batch operations patches 2024-03-01 11:00:05 +01:00
batch_records_ajax.pl Bug 34913: Adjust "Manage staged MARC records" 2024-01-26 15:13:43 +01:00
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 Bug 34478: Changes for tools/holidays 2024-03-01 10:58:36 +01:00
csv-profiles.pl Bug 34478: Correct op name in CSV profile deletion confirmation step 2024-03-01 11:00:07 +01:00
exceptionHolidays.pl Bug 34478: Changes for tools/holidays 2024-03-01 10:58:36 +01:00
export.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
holidays.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
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 Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
marc_modification_templates.pl Bug 34478: Fixes for MARC modification template management 2024-03-01 11:00:05 +01:00
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 Bug 34478: Changes for tools/holidays 2024-03-01 10:58:36 +01:00
overduerules.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
page.pl Bug 31383: Create a parent-child DB relation for additional content 2023-10-20 14:43:56 -03:00
picture-upload.pl Bug 34478: Manual - Replace link with submit button - circu-menu 2024-03-01 10:59:00 +01:00
problem-reports.pl Bug 34478: Manual fix - problem_reports 2024-03-01 10:56:59 +01:00
quotes-upload.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
quotes.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
scheduler.pl Bug 34478: (QA follow-up) Rename change to delete 2024-03-01 10:58:42 +01:00
showdiffmarc.pl Bug 31526: Follow-up for bug 29697 2022-09-16 10:25:48 -03:00
stage-marc-import.pl Bug 34478: Changes for tools/stage-marc-import 2024-03-01 10:58:40 +01:00
stockrotation.pl Bug 36193: cud- treatment for tools/stockrotation.pl 2024-03-12 17:47:33 +01: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 34478: (follow-up) upload-cover-image.pl: Remove bitwise-and from condition 2024-03-01 10:59:56 +01:00
upload-file.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
upload.pl Bug 34478: Changes for tools/upload 2024-03-01 10:58:42 +01:00
viewlog.pl Bug 35782: Replace TT plugin's method Biblio::HoldsCount 2024-03-15 09:38:39 +01:00