[Bug 24448] New: Add Koha::Biblio->subscriptions_count
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Bug ID: 24448 Summary: Add Koha::Biblio->subscriptions_count Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org -- 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=24448 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 | Blocks| |20212 CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |josef.moravec@gmail.com, | |kyle@bywatersolutions.com, | |liz@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com, | |tomascohen@gmail.com 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Tomás Cohen Arazi <tomascohen@gmail.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=24448 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 97525 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97525&action=edit Bug 24448: Unit tests This patch adds tests for the new method to be introduced. It also moves the tests for Koha::Biblio->subscriptions to the Biblio.t where it really belongs. To test, run this tests along with the patch implementing the new method. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 97526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97526&action=edit Bug 24448: Add Koha::Biblio->subscriptions_count This patch adds the handy subscriptions_count method to the Koha::Biblio class. It is intended to be used as a shortcut for $biblio->subscriptions->count in places like the API where we can embed the output of a method. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/Koha/Biblios.t => SUCCESS: Tests pass! i.e. Biblios.t still passes, and the tests for the new method in Biblio.t pass as well. 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agustinmoyano@theke.io -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Nick Clemens <nick@bywatersolutions.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=24448 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97525|0 |1 is obsolete| | Attachment #97526|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 97571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97571&action=edit Bug 24448: Unit tests This patch adds tests for the new method to be introduced. It also moves the tests for Koha::Biblio->subscriptions to the Biblio.t where it really belongs. To test, run this tests along with the patch implementing the new method. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=24448 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 97572 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97572&action=edit Bug 24448: Add Koha::Biblio->subscriptions_count This patch adds the handy subscriptions_count method to the Koha::Biblio class. It is intended to be used as a shortcut for $biblio->subscriptions->count in places like the API where we can embed the output of a method. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/Koha/Biblios.t => SUCCESS: Tests pass! i.e. Biblios.t still passes, and the tests for the new method in Biblio.t pass as well. 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=24448 Nicolas Legrand <nicolas.legrand@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nicolas.legrand@bulac.fr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- IMO we should not have ->subscriptions_count, but callers should ->subscriptions->count instead. What's the point of this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #5)
IMO we should not have ->subscriptions_count, but callers should ->subscriptions->count instead. What's the point of this?
I have to admit I was a bit confused by this too - can you explain Tomas? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- The short explanation is that we developed a way to embed things from the API using HTTP headers, and it can embed methods output. Take a look at this branch: https://gitlab.com/thekesolutions/Koha/tree/bug_20212_slowness_acq We could develop a way to specify we want to count things from the HTTP headers, but it is kind of overkill only for the sake of avoiding this simple method. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24435 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Tomás Cohen Arazi from comment #7)
The short explanation is that we developed a way to embed things from the API using HTTP headers, and it can embed methods output. Take a look at this branch:
https://gitlab.com/thekesolutions/Koha/tree/bug_20212_slowness_acq
We could develop a way to specify we want to count things from the HTTP headers, but it is kind of overkill only for the sake of avoiding this simple method.
Sorry, not understanding it yet :( What's the difference between subscriptions->count subscriptions->subscription_count in terms of the API? The first looks more standardized to me? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> ---
What's the difference between
subscriptions->count subscriptions->subscription_count
in terms of the API? The first looks more standardized to me?
Oh!.... this is a method in Biblio - that makes more sense now! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I will comment on koha-devel. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24467 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 [Bug 24467] *_count methods should be avoided -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|24467 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 [Bug 24467] Add a syntax for specifying counts on x-koha-embed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24467 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24467 [Bug 24467] *_count methods should be avoided -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=24448 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97571|0 |1 is obsolete| | Attachment #97572|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98033&action=edit Bug 24448: Unit tests This patch adds tests for the new method to be introduced. It also moves the tests for Koha::Biblio->subscriptions to the Biblio.t where it really belongs. To test, run this tests along with the patch implementing the new method. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> 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=24448 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98034&action=edit Bug 24448: Add Koha::Biblio->subscriptions_count This patch adds the handy subscriptions_count method to the Koha::Biblio class. It is intended to be used as a shortcut for $biblio->subscriptions->count in places like the API where we can embed the output of a method. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/Koha/Biblios.t => SUCCESS: Tests pass! i.e. Biblios.t still passes, and the tests for the new method in Biblio.t pass as well. 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> 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=24448 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98036 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98036&action=edit Bug 24448: Adding a notice to tell the _count methods are temporary See bug 24467. You are allowed to flog tcohen with an RJ45 cable if this is not fixed in the next months. 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=24448 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24448 --- Comment #14 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=24448 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to master |RESOLVED CC| |joy@bywatersolutions.com --- Comment #15 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