Bug 30016 - Remove GetOpenIssue subroutine
Summary: Remove GetOpenIssue subroutine
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-03 13:14 UTC by Nick Clemens
Modified: 2023-06-08 22:26 UTC (History)
4 users (show)

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


Attachments
Bug 30016: Remove GetOpenIssue subroutine (7.76 KB, patch)
2022-02-03 13:24 UTC, Nick Clemens
Details | Diff | Splinter Review
Sample koc file (97 bytes, text/plain)
2022-02-03 13:25 UTC, Nick Clemens
Details
Bug 30016: Remove GetOpenIssue subroutine (7.77 KB, patch)
2022-02-11 13:58 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 30016: Remove GetOpenIssue subroutine (7.77 KB, patch)
2022-08-18 15:25 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 30016: Remove GetOpenIssue subroutine (7.82 KB, patch)
2022-08-19 09:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 30016: Remove GetOpenIssue subroutine (7.87 KB, patch)
2022-08-28 09:27 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2022-02-03 13:14:20 UTC
This routine is just a SQL fetch of the issue row for an itemnumber - we should use Koha::Checkouts->find({itemnumber=>$itemnumber}) instead
Comment 1 Nick Clemens 2022-02-03 13:24:14 UTC Comment hidden (obsolete)
Comment 2 Nick Clemens 2022-02-03 13:25:02 UTC
Created attachment 130142 [details]
Sample koc file
Comment 3 Tomás Cohen Arazi 2022-02-04 19:15:37 UTC
Hi, this looks fine, but I think you meant to use $item->checkout, otherwise it is a DBIC row you're dealing with?
Comment 4 Nick Clemens 2022-02-11 13:58:16 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2022-02-19 20:33:22 UTC
Should we move this back to "Needs Sign-off"?
Comment 6 David Nind 2022-07-09 21:49:17 UTC
Patch no longer applies 8-(..

Applying: Bug 30016: Remove GetOpenIssue subroutine
Using index info to reconstruct a base tree...
M	C4/Circulation.pm
M	offline_circ/process_koc.pl
M	t/db_dependent/Circulation/issue.t
Falling back to patching base and 3-way merge...
Auto-merging t/db_dependent/Circulation/issue.t
CONFLICT (content): Merge conflict in t/db_dependent/Circulation/issue.t
Auto-merging offline_circ/process_koc.pl
Auto-merging C4/Circulation.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 30016: Remove GetOpenIssue subroutine
Comment 7 Nick Clemens 2022-08-18 15:25:45 UTC
Created attachment 139400 [details] [review]
Bug 30016: Remove GetOpenIssue subroutine

This patch adjusts the code that uses GetOpenIssue to use/find a Koha::Checkout object
instead

To test:
1 - Add a course to course reserves
2 - Create an item with barcode TESTKOC
3 - Add the item to a course
4 - Checkout the item
5 - View course details on stff and opac and confirm item shows as checked out and due date displays
6 - prove t/db_dependent/Circulation/issue.t t/db_dependent/Circulation.t t/db_dependent/CourseReserves.t
7 - Browse to Circulation->Upload offline circulation
8 - Upload a file to return the item: https://wiki.koha-community.org/wiki/Koha_offline_circulation_file_format
9 - Confirm item is returned
Comment 8 David Nind 2022-08-19 09:23:25 UTC
Created attachment 139451 [details] [review]
Bug 30016: Remove GetOpenIssue subroutine

This patch adjusts the code that uses GetOpenIssue to use/find a Koha::Checkout object
instead

To test:
1 - Add a course to course reserves
2 - Create an item with barcode TESTKOC
3 - Add the item to a course
4 - Checkout the item
5 - View course details on stff and opac and confirm item shows as checked out and due date displays
6 - prove t/db_dependent/Circulation/issue.t t/db_dependent/Circulation.t t/db_dependent/CourseReserves.t
7 - Browse to Circulation->Upload offline circulation
8 - Upload a file to return the item: https://wiki.koha-community.org/wiki/Koha_offline_circulation_file_format
9 - Confirm item is returned

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 Katrin Fischer 2022-08-28 09:27:12 UTC
Created attachment 139899 [details] [review]
Bug 30016: Remove GetOpenIssue subroutine

This patch adjusts the code that uses GetOpenIssue to use/find a Koha::Checkout object
instead

To test:
1 - Add a course to course reserves
2 - Create an item with barcode TESTKOC
3 - Add the item to a course
4 - Checkout the item
5 - View course details on stff and opac and confirm item shows as checked out and due date displays
6 - prove t/db_dependent/Circulation/issue.t t/db_dependent/Circulation.t t/db_dependent/CourseReserves.t
7 - Browse to Circulation->Upload offline circulation
8 - Upload a file to return the item: https://wiki.koha-community.org/wiki/Koha_offline_circulation_file_format
9 - Confirm item is returned

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Tomás Cohen Arazi 2022-08-31 11:51:48 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!