Bug 24117 - Patron does not get debarred upon returning overdue item if syspref item-level_itypes is set to biblio and item does not have type information
Summary: Patron does not get debarred upon returning overdue item if syspref item-leve...
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 19.05
Hardware: All All
: P5 - low minor (vote)
Assignee: Pedro Amorim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-26 12:28 UTC by Pedro Amorim
Modified: 2019-12-10 11:56 UTC (History)
5 users (show)

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


Attachments
Bugfix commit (1.40 KB, text/plain)
2019-11-26 12:44 UTC, Pedro Amorim
Details
Proposed fix for reported bug (1.63 KB, patch)
2019-11-26 12:48 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2019-11-26 12:28:44 UTC
To reproduce:
1) Have item-level_itypes sys pref set to "biblio"
2) Return an overdue item which biblio record has correct type information but item itself does not (which should be fine because 1))
3) Notice that the item is returned just fine, but the patron does not get debarred, respecting circulation rules correctly configured.
Comment 1 Pedro Amorim 2019-11-26 12:44:37 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2019-11-26 12:48:16 UTC
Created attachment 95822 [details] [review]
Proposed fix for reported bug
Comment 3 Jonathan Druart 2019-12-03 10:50:47 UTC
Hi Pedro,
As _debar_user_on_return is only called once I would suggest you to pass $item instead of $item_unblessed. It will avoid to pass yet another parameter to this subroutine.
Also you will need to provide a test plan in the commit message, as well as a better commit title

https://wiki.koha-community.org/wiki/Commit_messages
Comment 4 Pedro Amorim 2019-12-10 11:56:35 UTC
Hi Jonathan,
Thank you so much for your feedback.
In the past, the $item parameter was changed to $item_unblessed, by this commit https://github.com/Koha-Community/Koha/commit/31c29fd31f557306233e6a2936148a5bb10b89a1#diff-932a11a39c3f8c7127afb9c9a44318e7L2008

I opted to leave the code as it was previously written and add the parameter I needed, precisely because the function is only called once.

I did not have the opportunity to test the behaviour of _GetCircControlBranch when $item is being used instead of $item_unblessed but I'll try test it soon and follow your instructions.