http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5079
--- Comment #54 from David Cook <[email protected]> --- To be even more of a pain... It's also worth mentioning that the following code doesn't do what one would expect either: <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"> <xsl:choose> <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when> <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when> </xsl:choose> <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if> <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> </xsl:for-each> 1. Items are grouped by status and branch. That means that you will only ever get 1 entry for available items at branch X. As a result, "concat(items:location,' ')" is pointless, because there is only ever going to be one item and thus one items:location. 'select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"' means that we only get the first available item in the item-by-status-and-branch. If you change [1] to [2], you'll see the data for the second item instead. 2. Since we only get 1 entry for available items at branch X, we're not going to be showing all the locations, ccodes, and callnumbers available. If we want to get the locations, ccodes, and callnumbers, we need to create different sets of named keys like: <xsl:key name="item-by-status-and-branch-and-location" match="items:item" use="concat(items:status, ' ', items:homebranch, ' ', items:location)"/> <xsl:key name="item-by-status-and-branch-and-ccode" match="items:item" use="concat(items:status, ' ', items:homebranch, ' ', items:ccode)"/> <xsl:key name="item-by-status-and-branch-and-itemcallnumber" match="items:item" use="concat(items:status, ' ', items:homebranch, ' ', items:itemcallnumber)"/> Currently, if you have 2 available items with different locations/ccodes at branch X, only the first from the MARCXML returned by Zebra will be shown. That seems quite undesirable to me. -- It's worth mentioning that this problem exists elsewhere in the XSLT when we're trying to show call number as well. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
