Because of a T:T scoping issue the OPAC detail page will always show all items as "Available."
Created attachment 4166 [details] [review] Proposed fix The markup for showing item availability has been moved to an include file. The include lacked the scope declaration for the item results loop. Adding the scope declaration to the include file means it can't be used by other template unless within the same scope, but I'm not aware of a better way to do it given the number of variables in use.
Created attachment 4213 [details] [review] Signed-off patch with improvement
I confirm the bug. I propose a alternative solution which solve the bug and keep its versatility-reusability to the include file. With this solution, when including item-status.inc, the foreach loop variable name, which can change from template to template, is renamed by using a local variable definition: ie a variable name specified after file name in the INCLUDE directive, this variable temporally masking any existing variable.
Thanks Frédéric, your solution is the correct one. I knew I could pass an individual variable using that method but I didn't realize a whole loop could be passed the same way.
T::T Bug, pushed please test
E.g. opac-detail.pl?biblionumber=4 shows the correct mix of "Checked out" and "Available".