Bug 24457 - K::A::Basket->to_api is not passing the parameters to the parent class implementation
Summary: K::A::Basket->to_api is not passing the parameters to the parent class implem...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 18731
Blocks: 20212
  Show dependency treegraph
 
Reported: 2020-01-19 05:05 UTC by Tomás Cohen Arazi
Modified: 2020-02-06 22:58 UTC (History)
3 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 24457: Regression tests (2.05 KB, patch)
2020-01-19 05:08 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24457: Make overloaded ->to_api pass the params to parent method (1.21 KB, patch)
2020-01-19 05:08 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24457: Regression tests (2.11 KB, patch)
2020-01-19 21:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 24457: Make overloaded ->to_api pass the params to parent method (1.26 KB, patch)
2020-01-19 21:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 24457: Regression tests (2.18 KB, patch)
2020-01-21 16:03 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24457: Make overloaded ->to_api pass the params to parent method (1.33 KB, patch)
2020-01-21 16:03 UTC, Jonathan Druart
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-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.