[Bug 24467] New: *_count methods should be avoided
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Bug ID: 24467 Summary: *_count methods should be avoided Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Several new methods have been added recently to retrieve the number of elements returned (items_count, subscriptions_count, etc.) We should find a way to avoid that, as the callers can call ->count easily. -- 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=24467 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24435 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24435 [Bug 24435] Add Koha::Biblio->items_count -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24430, 24448 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24430 [Bug 24430] Remove C4::Biblio::CountBiblioInOrders https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 [Bug 24448] Add Koha::Biblio->subscriptions_count -- 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=24467 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agustinmoyano@theke.io, | |martin.renvoize@ptfs-europe | |.com Summary|*_count methods should be |Add a syntax for specifying |avoided |counts on x-koha-embed Component|Architecture, internals, |REST API |and plumbing | Version|unspecified |master Depends on|24430, 24448 | QA Contact|testopia@bugs.koha-communit | |y.org | Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |ASSIGNED --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Removing the introduced *_count methods will be a follow-up for this new feature if that's ok with you, Jonathan. I mean part of this bug. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24430 [Bug 24430] Remove C4::Biblio::CountBiblioInOrders https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 [Bug 24448] Add Koha::Biblio->subscriptions_count -- 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=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |testopia@bugs.koha-communit | |y.org Component|REST API |Architecture, internals, | |and plumbing Depends on| |24430, 24448 Assignee|tomascohen@gmail.com |koha-bugs@lists.koha-commun | |ity.org Summary|Add a syntax for specifying |*_count methods should be |counts on x-koha-embed |avoided Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24430 [Bug 24430] Remove C4::Biblio::CountBiblioInOrders https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 [Bug 24448] Add Koha::Biblio->subscriptions_count -- 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=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 97746 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97746&action=edit Bug 24467: Remove _count methods Add a trick to guess what we need to call. Note that it does not work, do not know why. Tests are missing to make sure everything is ok. -- 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=24467 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- This is what I had in mind. -- 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=24467 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20212 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Slowness in Receiving in Acquisitions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #3)
This is what I had in mind.
Nice, I would prefer the + separator. And was waiting for bug 24356 and the work Agustin is doing for sorting and filtering on related tables. -- 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=24467 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24440 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24440 [Bug 24440] Add ->holds and ->holds_count to Koha::Acquisition::Order -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24528 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24528 [Bug 24528] Add a syntax for specifying counts on x-koha-embed -- 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=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|20212 | Blocks| |20212 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Slowness in Receiving in Acquisitions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97746|0 |1 is obsolete| | -- 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=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 98198 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98198&action=edit Bug 24467: Remove _count methods introduced for API use This patch removes some methods that were introduced for API usage in the first iteration of the object embedding development effort. Those methods were obsoleted by bug 24528, which introduces a smarter way for Koha::Object->to_api to embed *_count attributes on the output structure based on the relationships and a call to ->count. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|24440 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24440 [Bug 24440] Add ->current_holds to Koha::Acquisition::Order -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 David Nind <david@davidnind.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=24467 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98198|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 98202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98202&action=edit Bug 24467: Remove _count methods introduced for API use This patch removes some methods that were introduced for API usage in the first iteration of the object embedding development effort. Those methods were obsoleted by bug 24528, which introduces a smarter way for Koha::Object->to_api to embed *_count attributes on the output structure based on the relationships and a call to ->count. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |josef.moravec@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Josef Moravec <josef.moravec@gmail.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=24467 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98202|0 |1 is obsolete| | --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 98218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98218&action=edit Bug 24467: Remove _count methods introduced for API use This patch removes some methods that were introduced for API usage in the first iteration of the object embedding development effort. Those methods were obsoleted by bug 24528, which introduces a smarter way for Koha::Object->to_api to embed *_count attributes on the output structure based on the relationships and a call to ->count. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 --- Comment #8 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 98219 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98219&action=edit Bug 24467: (QA follow-up) Fix POD in Koha::Biblio Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 --- Comment #9 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 98220 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98220&action=edit Bug 24467: (QA follow-up) Clarify tests wording for ->count methods Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.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=24467 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Bug 24467 depends on bug 24430, which changed state. Bug 24430 Summary: Remove C4::Biblio::CountBiblioInOrders https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24430 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Bug 24467 depends on bug 24435, which changed state. Bug 24435 Summary: Add Koha::Biblio->items_count https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24435 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Bug 24467 depends on bug 24448, which changed state. Bug 24448 Summary: Add Koha::Biblio->subscriptions_count https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Bug 24467 depends on bug 24528, which changed state. Bug 24528 Summary: Add a syntax for specifying counts on x-koha-embed https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24528 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com Status|Pushed to master |RESOLVED Resolution|--- |FIXED --- Comment #11 from Joy Nelson <joy@bywatersolutions.com> --- Enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org