Bug 24430 - Remove C4::Biblio::CountBiblioInOrders
Summary: Remove C4::Biblio::CountBiblioInOrders
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 24418
Blocks: 17628 20212 24672 24435 24467
  Show dependency treegraph
 
Reported: 2020-01-15 19:08 UTC by Tomás Cohen Arazi
Modified: 2020-02-17 13:57 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 24430: Unit tests (1.83 KB, patch)
2020-01-15 19:30 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24430: Add ->orders and ->orders_count to Koha::Biblio (2.28 KB, patch)
2020-01-15 19:30 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24430: Remove CountBiblioInOrders and its traces (3.29 KB, patch)
2020-01-15 19:30 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24430: Remove CountBiblioInOrders and its traces (3.43 KB, patch)
2020-01-16 14:37 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24430: Unit tests (2.23 KB, patch)
2020-01-16 15:33 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24430: Add ->orders and ->active_orders_count to Koha::Biblio (2.47 KB, patch)
2020-01-16 15:33 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24430: Remove CountBiblioInOrders and its traces (3.31 KB, patch)
2020-01-16 15:33 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24430: Unit tests (2.29 KB, patch)
2020-01-17 20:12 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24430: Add ->orders and ->active_orders_count to Koha::Biblio (2.53 KB, patch)
2020-01-17 20:12 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24430: Remove CountBiblioInOrders and its traces (3.37 KB, patch)
2020-01-17 20:12 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24430: Unit tests (2.34 KB, patch)
2020-01-21 11:23 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24430: Add ->orders and ->active_orders_count to Koha::Biblio (2.59 KB, patch)
2020-01-21 11:23 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24430: Remove CountBiblioInOrders and its traces (3.43 KB, patch)
2020-01-21 11:23 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2020-01-15 19:08:47 UTC
Using the DBIC relationship with aqorders and count, we can get rid of it.
Comment 1 Tomás Cohen Arazi 2020-01-15 19:30:12 UTC
Created attachment 97414 [details] [review]
Bug 24430: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2020-01-15 19:30:15 UTC
Created attachment 97415 [details] [review]
Bug 24430: Add ->orders and ->orders_count to Koha::Biblio

This patch introduces an accessor to the related orders, and a method
that returns the orders count. The target usage for the count is the
API. In the rest of the codebase, we would just call:

    $biblio->orders->count

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2020-01-15 19:30:18 UTC
Created attachment 97416 [details] [review]
Bug 24430: Remove CountBiblioInOrders and its traces

This patch replaces the only uses of CountBiblioInOrders and makes that
code use $biblio->orders->count instead.

Test nothing breaks in basket.pl and parcel.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2020-01-16 14:37:52 UTC
Created attachment 97443 [details] [review]
Bug 24430: Remove CountBiblioInOrders and its traces

This patch replaces the only uses of CountBiblioInOrders and makes that
code use $biblio->orders->count instead.

Test nothing breaks in basket.pl and parcel.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi 2020-01-16 15:33:14 UTC
Created attachment 97446 [details] [review]
Bug 24430: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi 2020-01-16 15:33:17 UTC
Created attachment 97447 [details] [review]
Bug 24430: Add ->orders and ->active_orders_count to Koha::Biblio

This patch introduces an accessor to the related orders, and a method
that returns the active orders count. The target usage for the count is the
API. In the rest of the codebase, we would just call:

    $biblio->orders->count

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi 2020-01-16 15:33:21 UTC
Created attachment 97448 [details] [review]
Bug 24430: Remove CountBiblioInOrders and its traces

This patch replaces the only uses of CountBiblioInOrders and makes that
code use $biblio->orders->count instead.

Test nothing breaks in basket.pl and parcel.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Nick Clemens 2020-01-17 20:12:20 UTC
Created attachment 97563 [details] [review]
Bug 24430: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens 2020-01-17 20:12:22 UTC
Created attachment 97564 [details] [review]
Bug 24430: Add ->orders and ->active_orders_count to Koha::Biblio

This patch introduces an accessor to the related orders, and a method
that returns the active orders count. The target usage for the count is the
API. In the rest of the codebase, we would just call:

    $biblio->orders->count

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Nick Clemens 2020-01-17 20:12:25 UTC
Created attachment 97565 [details] [review]
Bug 24430: Remove CountBiblioInOrders and its traces

This patch replaces the only uses of CountBiblioInOrders and makes that
code use $biblio->orders->count instead.

Test nothing breaks in basket.pl and parcel.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Martin Renvoize 2020-01-21 11:23:14 UTC
Created attachment 97652 [details] [review]
Bug 24430: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2020-01-21 11:23:18 UTC
Created attachment 97653 [details] [review]
Bug 24430: Add ->orders and ->active_orders_count to Koha::Biblio

This patch introduces an accessor to the related orders, and a method
that returns the active orders count. The target usage for the count is the
API. In the rest of the codebase, we would just call:

    $biblio->orders->count

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2020-01-21 11:23:21 UTC
Created attachment 97654 [details] [review]
Bug 24430: Remove CountBiblioInOrders and its traces

This patch replaces the only uses of CountBiblioInOrders and makes that
code use $biblio->orders->count instead.

Test nothing breaks in basket.pl and parcel.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2020-01-21 11:24:08 UTC
Trivial improvements that simplify code.. Passing QA
Comment 15 Martin Renvoize 2020-01-21 11:36:52 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 16 Joy Nelson 2020-02-06 22:29:02 UTC
enhancement not backported to 19.11.x