Koha-clms/t/Koha
Julian Maurice 1a1313a9e0 Bug 36432: Remove circular dependency from Koha::Object
Koha::Object depends on Koha::DateUtils, which depends on C4::Context,
which depends on Koha::Config::SysPref, which depends on... Koha::Object

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::Object (YAML::XS and ZOOM for instance).
As Koha::Object is used as a base for a lot of modules, we should take
care to only load the minimum required.

This patch moves some date parsing code to specific modules:
- Koha::DateTime::Format::RFC3339
- Koha::DateTime::Format::SQL

and it uses them in Koha::Object and Koha::DateUtils where it is
possible.

Test plan:
1. Do not apply the patch yet and run the following command:
   `perl -cw Koha/Object.pm`
   It should print several warnings about redefined subroutines, meaning
   there is a circular dependency.
2. Apply the patch
3. Run `perl -cw Koha/Object.pm`. It should only say:
   "Koha/Object.pm syntax OK"
4. Run the following command:
    prove \
        t/DateUtils.t \
        t/Koha/DateTime/Format/RFC3339.t \
        t/db_dependent/Koha/Object.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8d5299639e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0c862533d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-05-28 16:36:58 +00:00
..
Auth Bug 34844: Add manage_item_editor_templates to userpermissions.sql 2023-09-22 09:25:52 -10:00
Authority
…
Database
…
DateTime/Format Bug 36432: Remove circular dependency from Koha::Object 2024-05-28 16:36:58 +00:00
I18N/po/xx_XX/LC_MESSAGES
…
Middleware Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env 2023-07-12 09:22:00 +01:00
Object
…
Plugins
…
REST/Plugin Bug 32713: Unit tests 2023-03-16 16:12:26 -03:00
Result
…
SearchEngine Bug 33406: (follow-up) Mock SearchEngine to ensure using ES 2023-09-18 10:04:48 -10:00
Util
…
Config.t Bug 31393: Tidy 2023-11-07 22:14:10 -10:00
Email.t
…
Exceptions.t Bug 32334: Exceptions - Add parameter to WrongParameter 2023-04-12 11:21:55 -03:00
I18N.t
…
ItemType.t
…
RDF.t
…
Script.t
…
Script_cron.t
…
Z3950responder.t
…
sleep.pl
…
wait.pl
…