[Bug 36526] New: Remove circular dependency from Koha::Objects
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Bug ID: 36526 Summary: Remove circular dependency from Koha::Objects Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org Similar to bug 36432 Koha::Objects depends on Koha::DateUtils, which depends on C4::Context, which depends on Koha::Config::SysPrefs, which depends on Koha::Objects -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 164431 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164431&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164431|0 |1 is obsolete| | --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 164432 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164432&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 --- Comment #3 from HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> --- Created attachment 166104 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166104&action=edit Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164432|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166108 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166108&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Attachment #166104|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice improvement here, thanks Julain and Tadeusz. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.06 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED CC| |lucas@bywatersolutions.com --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Doesn't apply cleanly to 23.05.x, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36526 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=40680 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org