The different settings from the OpacItemLocation don't appear to work correctly. When "collection" is selected, collection is not visible, but a label 'Location(s)' shows up? The callnumber never showed for me in my testing?
Created attachment 97221 [details] Screenshot of modified template Does this look correct? The screenshot shows the results from the three different OpacItemLocation settings: - Call number - Location - Collection
Created attachment 97225 [details] [review] Bug 24352: OpacItemLocation is buggy This patch modifies the OPAC's MARC21 search results XSLT so that the OpacItemLocation preference correctly controls what information displays. Previously the code for distinguishing between the 'location' and 'collection' settings was combined. To test, apply the patch and set the OPACXSLTResultsDisplay system preference to 'default.' Set the OpacItemLocation preference to 'call number only.' - On the OPAC search results page, each result with items should show information in this format: - "Availability: Items available for loan: {library} [Call number: {call number} ] With the OpacItemLocation preference set to 'collection code,' - "Availability: Items available for loan: {library} Collection(s): {collection description} [{ call number }]" With the OpacItemLocation preference set to 'location,' - "Availability: Items available for loan: {library} Location(s): {shelving location} [{ call number }]"
These are the results for me from changing OpacItemLocation after applying the patch (searching for cat on koha-testing-docker): call number only - doesn't show the call number: Availability: Items available for loan: Fairview (2), Midway (1). collection code: Availability: Items available for loan: Fairview (2), Midway (1). Collection(s): GEN , GEN . location: Availability: Items available for loan: Fairview (2), Midway (1). Location(s): General Stacks , General Stacks .
David, it sounds like you're seeing what Katrin was seeing, but I don't know what might be different about our setup/data to cause it--assuming you're looking at records which have call numbers?
Face palm - records didn't have call numbers!
Created attachment 97257 [details] [review] Bug 24352: OpacItemLocation is buggy This patch modifies the OPAC's MARC21 search results XSLT so that the OpacItemLocation preference correctly controls what information displays. Previously the code for distinguishing between the 'location' and 'collection' settings was combined. To test, apply the patch and set the OPACXSLTResultsDisplay system preference to 'default.' Set the OpacItemLocation preference to 'call number only.' - On the OPAC search results page, each result with items should show information in this format: - "Availability: Items available for loan: {library} [Call number: {call number} ] With the OpacItemLocation preference set to 'collection code,' - "Availability: Items available for loan: {library} Collection(s): {collection description} [{ call number }]" With the OpacItemLocation preference set to 'location,' - "Availability: Items available for loan: {library} Location(s): {shelving location} [{ call number }]" Signed-off-by: David Nind <david@davidnind.com>
I sorry Owen, not having a good run on your patches tonight :( In my setup this doesn't work when there are no collections set on any of the items on the record: Collection(s): . Could you have another look please?
(In reply to Katrin Fischer from comment #7) > Collection(s): . It still sounds to me like the item must not have a call number. Even if the items have no location, for instance, the call numbers show up for me: https://zivotdesign.com/p/view.php?p=15791100203899
Hi Owen, you were right, but still struggling a bit with these patches, can you help? These are my items: Books Centerville Fiction Non-fiction 782.42166092 B (Browse shelf) Available Books Centerville New Materials Shelf Non-fiction 782.42166092 B (Browse shelf) Pending hold Books Union Fiction Reference 782.42166092 B (Browse shelf) Available So all 3 have locations, one is a pending hold, 2 are available. In the result list, only reference shows: Availability: Items available for loan: Centerville (2). Pending hold (1). Collection(s): Reference [782.42166092 B]. Can you tell why the collection Non-fiction doesn't show?
Created attachment 105931 [details] [review] Bug 24352: Correct location and collection labels in OPAC search results This patch modifies the OPAC's MARC21 search results XSLT so that OPAC search result information is correctly labeled based on the OpacItemLocation preference. Previously, search results showed the label "Location(s)" whether the setting was "collection code" or "location." To test, apply the patch and set the OPACXSLTResultsDisplay system preference to 'default.' On the OPAC search results page, each result with items should show information in this format: With the OpacItemLocation preference set to 'call number only,' - "Availability: Items available for loan: {library} [Call number: {call number} ] With the OpacItemLocation preference set to 'collection code,' - "Availability: Items available for loan: {library} Collection(s): {collection description} [{ call number }]" With the OpacItemLocation preference set to 'location,' - "Availability: Items available for loan: {library} Location(s): {shelving location} [{ call number }]"
The new patch changes much less, in part because the XSL markup has changed a lot since I submitted the original patch. I'm still not certain I understand the original bug report, but I fixed what problem I could see.
Created attachment 105948 [details] [review] Bug 24352: Correct location and collection labels in OPAC search results This patch modifies the OPAC's MARC21 search results XSLT so that OPAC search result information is correctly labeled based on the OpacItemLocation preference. Previously, search results showed the label "Location(s)" whether the setting was "collection code" or "location." To test, apply the patch and set the OPACXSLTResultsDisplay system preference to 'default.' On the OPAC search results page, each result with items should show information in this format: With the OpacItemLocation preference set to 'call number only,' - "Availability: Items available for loan: {library} [Call number: {call number} ] With the OpacItemLocation preference set to 'collection code,' - "Availability: Items available for loan: {library} Collection(s): {collection description} [{ call number }]" With the OpacItemLocation preference set to 'location,' - "Availability: Items available for loan: {library} Location(s): {shelving location} [{ call number }]" Signed-off-by: David Nind <david@davidnind.com>
Leaving QA to Katrin as the original bug reporter.
There are still some oddities (punctuation, repeating the same location/collection), but I believe this is a great improvement :)
Created attachment 106171 [details] [review] Bug 24352: Correct location and collection labels in OPAC search results This patch modifies the OPAC's MARC21 search results XSLT so that OPAC search result information is correctly labeled based on the OpacItemLocation preference. Previously, search results showed the label "Location(s)" whether the setting was "collection code" or "location." To test, apply the patch and set the OPACXSLTResultsDisplay system preference to 'default.' On the OPAC search results page, each result with items should show information in this format: With the OpacItemLocation preference set to 'call number only,' - "Availability: Items available for loan: {library} [Call number: {call number} ] With the OpacItemLocation preference set to 'collection code,' - "Availability: Items available for loan: {library} Collection(s): {collection description} [{ call number }]" With the OpacItemLocation preference set to 'location,' - "Availability: Items available for loan: {library} Location(s): {shelving location} [{ call number }]" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.02
backported to 19.11.x for 19.11.08
Backported to 19.05.x branch for 19.05.14