[Bug 36432] New: Remove circular dependency from Koha::Object
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Bug ID: 36432 Summary: Remove circular dependency from Koha::Object 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 Koha::Object depends on Koha::DateUtils, which depends on C4::Context, which depends on Koha::Config::SysPref, which depends on... Koha::Object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 163940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163940&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 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=36432 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163940|0 |1 is obsolete| | --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 163941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163941&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163941|0 |1 is obsolete| | --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 163942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163942&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163942|0 |1 is obsolete| | --- Comment #4 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 163971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163971&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |victor@tuxayo.net --- Comment #5 from Victor Grousset/tuxayo <victor@tuxayo.net> --- It works :) --- To spare a QA roundtrip here is the next step: FAIL Koha/DateTime/Format/RFC3339.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 5) FAIL Koha/DateTime/Format/SQL.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 2) WARN t/Koha/DateTime/Format/RFC3339.t WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 23) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163971|0 |1 is obsolete| | --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 163975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163975&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Victor Grousset/tuxayo from comment #5)
To spare a QA roundtrip here is the next step:
Thanks. I attached a new patch that should pass all QA tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163975|0 |1 is obsolete| | --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 164056 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164056&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 --- Comment #9 from Victor Grousset/tuxayo <victor@tuxayo.net> --- thanks :) ---- Added back signoff lost in the process. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164056|0 |1 is obsolete| | --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 164210 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164210&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36486 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36486 [Bug 36486] Add tests for Koha::DateTime::Format::SQL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Thanks for testing! I added some unit tests for Koha::DateTime::Format::SQL in bug 36486 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |24.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 --- Comment #12 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=36432 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36526 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35959 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|24.05.00 |24.05.00,23.11.06 released in| | Status|Pushed to main |Pushed to stable --- Comment #13 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=36432 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|24.05.00,23.11.06 |24.05.00,23.11.06,23.05.12 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #14 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 23.05.x for upcoming 23.05.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30717 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30717 [Bug 30717] Dates displayed in ISO format when editing items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37831 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37831 [Bug 37831] Timezone ignored when passing rfc3339 formatted date -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|37831 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37831 [Bug 37831] [OMNIBUS] Timezone ignored when passing rfc3339 formatted date -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36432 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