Bug 6364 - Display of item availability broken on OPAC detail screen
Summary: Display of item availability broken on OPAC detail screen
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Owen Leonard
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks: 5917
  Show dependency treegraph
 
Reported: 2011-05-18 14:57 UTC by Owen Leonard
Modified: 2012-10-25 23:09 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed fix (3.57 KB, patch)
2011-05-18 15:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Signed-off patch with improvement (4.83 KB, patch)
2011-05-21 06:39 UTC, Frédéric Demians
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2011-05-18 14:57:20 UTC
Because of a T:T scoping issue the OPAC detail page will always show all items as "Available."
Comment 1 Owen Leonard 2011-05-18 15:06:32 UTC
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.
Comment 2 Frédéric Demians 2011-05-21 06:39:12 UTC
Created attachment 4213 [details] [review]
Signed-off patch with improvement
Comment 3 Frédéric Demians 2011-05-21 06:40:32 UTC
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.
Comment 4 Owen Leonard 2011-05-23 13:32:55 UTC
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.
Comment 5 Chris Cormack 2011-05-29 03:51:17 UTC
T::T Bug, pushed please test
Comment 6 Magnus Enger 2011-07-16 09:25:54 UTC
E.g. opac-detail.pl?biblionumber=4 shows the correct mix of "Checked out" and "Available".