Bug 24457

Summary: K::A::Basket->to_api is not passing the parameters to the parent class implementation
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, jonathan.druart, nicolas.legrand
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24459
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Bug Depends on: 18731    
Bug Blocks: 20212    
Attachments: Bug 24457: Regression tests
Bug 24457: Make overloaded ->to_api pass the params to parent method
Bug 24457: Regression tests
Bug 24457: Make overloaded ->to_api pass the params to parent method
Bug 24457: Regression tests
Bug 24457: Make overloaded ->to_api pass the params to parent method

Description Tomás Cohen Arazi 2020-01-19 05:05:13 UTC
it calls $self->SUPER::to_api but misses to pass the parameers. This makes embedding related objects fail to work.
Comment 1 Tomás Cohen Arazi 2020-01-19 05:08:47 UTC
Created attachment 97586 [details] [review]
Bug 24457: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2020-01-19 05:08:50 UTC
Created attachment 97587 [details] [review]
Bug 24457: Make overloaded ->to_api pass the params to parent method

This patch makes the overloaded to_api method for baskets care about the
remaining parameters, and pass them to SUPER::to_api.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> FAIL: Tests fail! No embedded bookseller!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 David Nind 2020-01-19 21:13:36 UTC
Created attachment 97588 [details] [review]
Bug 24457: Regression tests

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

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2020-01-19 21:13:40 UTC
Created attachment 97589 [details] [review]
Bug 24457: Make overloaded ->to_api pass the params to parent method

This patch makes the overloaded to_api method for baskets care about the
remaining parameters, and pass them to SUPER::to_api.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> FAIL: Tests fail! No embedded bookseller!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Jonathan Druart 2020-01-21 15:59:03 UTC
What about Koha/Acquisition/Invoice.pm and Koha/Patron.pm?
Comment 6 Jonathan Druart 2020-01-21 15:59:41 UTC
(In reply to Jonathan Druart from comment #5)
> What about Koha/Acquisition/Invoice.pm and Koha/Patron.pm?

On bug 24459 I guess...
Comment 7 Jonathan Druart 2020-01-21 16:03:55 UTC
Created attachment 97672 [details] [review]
Bug 24457: Regression tests

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

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2020-01-21 16:03:59 UTC
Created attachment 97673 [details] [review]
Bug 24457: Make overloaded ->to_api pass the params to parent method

This patch makes the overloaded to_api method for baskets care about the
remaining parameters, and pass them to SUPER::to_api.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> FAIL: Tests fail! No embedded bookseller!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Martin Renvoize 2020-01-23 09:11:05 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 10 Joy Nelson 2020-02-06 22:58:05 UTC
Missing dependencies in 19.11.x not backported.