Bug 24459 - Overloaded ->to_api needs to pass $params through
Summary: Overloaded ->to_api needs to pass $params through
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 18731
Blocks:
  Show dependency treegraph
 
Reported: 2020-01-20 12:28 UTC by Tomás Cohen Arazi
Modified: 2020-11-30 21:44 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 24459: Regression tests (4.35 KB, patch)
2020-01-20 12:51 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24459: Make ->to_api pass $params through (1.78 KB, patch)
2020-01-20 12:51 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 24459: Regression tests (4.43 KB, patch)
2020-01-21 16:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24459: Make ->to_api pass $params through (1.86 KB, patch)
2020-01-21 16:04 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-20 12:28:03 UTC

    
Comment 1 Tomás Cohen Arazi 2020-01-20 12:28:55 UTC
There are previously defined ->to_api methods in the Koha::* namespace that are missing  parameters handling. See bug 24457
Comment 2 Tomás Cohen Arazi 2020-01-20 12:51:13 UTC
Created attachment 97621 [details] [review]
Bug 24459: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2020-01-20 12:51:17 UTC
Created attachment 97622 [details] [review]
Bug 24459: Make ->to_api pass $params through

This patch makes the to_api method in Koha::Acquisition::Inovice and
Koha::Patron pass the passed parameters to the base class to_api method.
This is required for things like embedding related objects.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Jonathan Druart 2020-01-21 16:04:38 UTC
Created attachment 97674 [details] [review]
Bug 24459: Regression tests

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2020-01-21 16:04:42 UTC
Created attachment 97675 [details] [review]
Bug 24459: Make ->to_api pass $params through

This patch makes the to_api method in Koha::Acquisition::Inovice and
Koha::Patron pass the passed parameters to the base class to_api method.
This is required for things like embedding related objects.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patron.t \
           t/db_dependent/Koha/Acquisition/Invoice.t
=> FAIL: Tests fail!
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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2020-01-21 16:05:09 UTC
Trivial, same as bug 24457, skipping QA.
Comment 7 Martin Renvoize 2020-01-23 09:11:09 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Joy Nelson 2020-02-06 22:58:41 UTC
dependencies lacking in 19.11.x  not backported