Bug 21999 - C4::Circulation::AddIssue uses DBIx::Class directly
Summary: C4::Circulation::AddIssue uses DBIx::Class directly
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: Martin Renvoize
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 21720
  Show dependency treegraph
 
Reported: 2018-12-14 10:17 UTC by Martin Renvoize
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

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


Attachments
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue (2.69 KB, patch)
2018-12-14 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21999: Update Tests to reflect new return value of AddIssue (5.37 KB, patch)
2018-12-14 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue (2.75 KB, patch)
2018-12-14 19:43 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 21999: Update Tests to reflect new return value of AddIssue (5.42 KB, patch)
2018-12-14 19:43 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue (2.83 KB, patch)
2018-12-17 21:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21999: Update Tests to reflect new return value of AddIssue (5.51 KB, patch)
2018-12-17 21:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21999: FIXMEs are fixed! (1.26 KB, patch)
2018-12-17 21:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21999: Move attributes to a variable to not dup them (2.70 KB, patch)
2018-12-17 21:29 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 Martin Renvoize 2018-12-14 10:17:13 UTC
This should now call Koha::Checkouts instead.
Comment 1 Martin Renvoize 2018-12-14 15:07:33 UTC
Created attachment 83215 [details] [review]
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue
Comment 2 Martin Renvoize 2018-12-14 15:07:36 UTC
Created attachment 83216 [details] [review]
Bug 21999: Update Tests to reflect new return value of AddIssue
Comment 3 Martin Renvoize 2018-12-14 15:22:52 UTC
So.. this is a bit of a 'quick fix'.. the long term we will likely want to deprecate AddIssue and move it into Koha::*.. but, some places already expect the returned value to be a Koha::Checkout so this is the patch I've come up with.

Test plan.. the majority of places that call AddIssue do so in VOID context and so this change of return value should not affect them.  Most cases where the return value is used were in the tests and those have been updated in the second patch... that just leaves `circ/circulation.pl` where the return is passed into the template (and the Koha::Object should be seamless there).

Finally, SIP uses the returned value too but in such a way that the Koha::Checkout being returned instead is also fine (as we only ever look at the date_due field).

To Test.. apply patches.. run the full test suit and everything should pass.
Comment 4 Pierre-Marc Thibault 2018-12-14 19:43:11 UTC
Created attachment 83244 [details] [review]
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Comment 5 Pierre-Marc Thibault 2018-12-14 19:43:14 UTC
Created attachment 83245 [details] [review]
Bug 21999: Update Tests to reflect new return value of AddIssue

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Comment 6 Jonathan Druart 2018-12-17 21:29:35 UTC
Created attachment 83327 [details] [review]
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2018-12-17 21:29:40 UTC
Created attachment 83328 [details] [review]
Bug 21999: Update Tests to reflect new return value of AddIssue

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2018-12-17 21:29:47 UTC
Created attachment 83329 [details] [review]
Bug 21999: FIXMEs are fixed!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2018-12-17 21:29:54 UTC
Created attachment 83330 [details] [review]
Bug 21999: Move attributes to a variable to not dup them

Avoid c/p as much as possible :)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Nick Clemens 2019-01-11 13:34:32 UTC
Awesome work all!

Pushed to master for 19.05
Comment 11 Martin Renvoize 2019-01-14 14:11:59 UTC
Enhancement, will not be backported to 18.11.x series