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.
Created attachment 95820 [details] Bugfix commit
Created attachment 95822 [details] [review] Proposed fix for reported bug
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
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.