Bug 15524 changed CanItemBeReserved to return a hashref with status inside. Looks like But 23116 was intruced with previous behavior. So now there a uses of CanItemBeReserved return value as a string : if ( $can_item_be_reserved eq 'OK' || ( $can_item_be_reserved ne 'itemAlreadyOnHold' && $can_override ) ) { use git grep can_item_be_reserved.
Also impact on Bug 22330
(In reply to Fridolin SOMERS from comment #1) > Also impact on Bug 22330 Oups sorry no its correct : my $canitembereserved = C4::Reserves::CanItemBeReserved( $borrowernumber, $itemnumber, $branch )->{status};
Created attachment 95994 [details] [review] Bug 24168: (bug 23116 follow-up) AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold This patch actually fixes the issue described on bug 23116. Test plan: See bug 23116.
Hmm. I actually do not see the difference this patch makes. Looks to me if nothing really changes here. Before we tested $var->{status} eq 'OK' and now we put status into $var and test $var eq 'OK'. Where is the bug that we should solve ?
Take a look at the file and search for "can_item_be_reserved". There is another occurrence.
Created attachment 96099 [details] [review] Bug 24168: (bug 23116 follow-up) AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold This patch actually fixes the issue described on bug 23116. Test plan: See bug 23116. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> See also comment5. Important to note that the later comparison with itemAlreadyOnHold assumes that the variable is a string.
(In reply to Jonathan Druart from comment #5) > Take a look at the file and search for "can_item_be_reserved". > There is another occurrence. OK Thats the point. Passed QA
Nice work everyone! Pushed to master for 20.05
Pushed to stable 19.11.01
backported to 19.05.x for 19.05.06