[Bug 42396] New: Replace C4::Stats::UpdateStats calls with Koha::Statistic->store
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 Bug ID: 42396 Summary: Replace C4::Stats::UpdateStats calls with Koha::Statistic->store Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Depends on: 19871 C4::Stats::UpdateStats is a trivial legacy wrapper that just calls Koha::Statistic->new($params)->store. All callers should use the Koha::Statistic object directly instead of going through the C4 shim. Callers to update: - Koha::Item::_add_statistic - C4::Circulation - C4::Accounts - Koha::Account - Koha::Recalls - Koha::ILL::Request Once all callers are migrated, C4::Stats can be removed entirely. Identified during QA review of bug 19871. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19871 [Bug 19871] Use new exceptions Koha::Exceptions::Object::DuplicateID and FKConstraint -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |chloe.zermatten@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chloe.zermatten@openfifth.c |olivia.reynolds@openfifth.c |o.uk |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Sponsorship status|--- |Sponsored Comma delimited| |Open Fifth list of Sponsors| | Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 --- Comment #1 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 200894 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200894&action=edit Bug 42396: Remove C4::Stats::UpdateStats and delete module This patch replaces all calls to C4::Stats::UpdateStats with the wrapped function from the Koha namespace. As this is the last function in C4::Stats, the module is also deleted. Several tests depended on transitive includes to Koha::Statistics through C4::Stats. I've identified uses of that module by searching, and added the necessary use in each case. I've run `prove -r t xt` with this patch applied and didn't hit any relevant errors. Test plan: 1. Inspect the patch, and verify each changed call maintains the same parameters. 2. Apply patch. 3. Prove the following files: - t/db_dependent/Accounts.t - t/db_dependent/Circulation.t - t/db_dependent/Koha/Account.t - t/db_dependent/Koha/ILL/Request.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Pseudonymization.t - t/db_dependent/Koha/Recalls.t Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 Jonathan Druart <jonathan.druart@gmail.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=42396 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200894|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=42396 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 201174 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201174&action=edit Bug 42396: Remove C4::Stats::UpdateStats and delete module This patch replaces all calls to C4::Stats::UpdateStats with the wrapped function from the Koha namespace. As this is the last function in C4::Stats, the module is also deleted. Several tests depended on transitive includes to Koha::Statistics through C4::Stats. I've identified uses of that module by searching, and added the necessary use in each case. I've run `prove -r t xt` with this patch applied and didn't hit any relevant errors. Test plan: 1. Inspect the patch, and verify each changed call maintains the same parameters. 2. Apply patch. 3. Prove the following files: - t/db_dependent/Accounts.t - t/db_dependent/Circulation.t - t/db_dependent/Koha/Account.t - t/db_dependent/Koha/ILL/Request.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Pseudonymization.t - t/db_dependent/Koha/Recalls.t Sponsored-by: Open Fifth Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42396 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 201175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201175&action=edit Bug 42396: Adjust 'use' statements Always include the plural version, not the singular one (the plural imports the singular) Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org