Bug 31485 - Move ItemsDeniedRenewal checks from C4::Circulation to Koha::Item
Summary: Move ItemsDeniedRenewal checks from C4::Circulation to Koha::Item
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Joonas Kylmälä
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-29 18:44 UTC by Joonas Kylmälä
Modified: 2023-12-28 20:42 UTC (History)
3 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
Circulation function:


Attachments
Bug 31485: Move _item_denied_renewal to Koha::Item (12.95 KB, patch)
2022-08-29 18:55 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 31485: Move _item_denied_renewal to Koha::Item (12.99 KB, patch)
2022-09-12 20:11 UTC, David Nind
Details | Diff | Splinter Review
Bug 31485: Move _item_denied_renewal to Koha::Item (13.05 KB, patch)
2022-10-07 22:39 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 Joonas Kylmälä 2022-08-29 18:44:29 UTC
C4/Circulation.pm contains currently a function called _item_denied_renewal which is clearly a method of Koha::Item, thus it should be moved there.
Comment 1 Joonas Kylmälä 2022-08-29 18:55:55 UTC
Created attachment 139965 [details] [review]
Bug 31485: Move _item_denied_renewal to Koha::Item

The question whether item is denied renewal doesn't depend on
circulation rules or the patron, it is only a property of the item and
only changes to the item's attributes can cause the return value of
the check to change, thus we should move this to be a method of
Koha::Item.

To test:
 1) Run unit tests
    $ prove t/db_dependent/Circulation.t
    $ prove t/db_dependent/Koha/Item.t
Comment 2 David Nind 2022-09-12 20:11:32 UTC
Created attachment 140506 [details] [review]
Bug 31485: Move _item_denied_renewal to Koha::Item

The question whether item is denied renewal doesn't depend on
circulation rules or the patron, it is only a property of the item and
only changes to the item's attributes can cause the return value of
the check to change, thus we should move this to be a method of
Koha::Item.

To test:
 1) Run unit tests
    $ prove t/db_dependent/Circulation.t
    $ prove t/db_dependent/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2022-10-07 22:39:40 UTC
Created attachment 141533 [details] [review]
Bug 31485: Move _item_denied_renewal to Koha::Item

The question whether item is denied renewal doesn't depend on
circulation rules or the patron, it is only a property of the item and
only changes to the item's attributes can cause the return value of
the check to change, thus we should move this to be a method of
Koha::Item.

To test:
 1) Run unit tests
    $ prove t/db_dependent/Circulation.t
    $ prove t/db_dependent/Koha/Item.t

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Tomás Cohen Arazi (tcohen) 2022-10-11 13:23:41 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!