Bug 9174 - Item type image does not display for biblio-level itemtypes in list display in OPAC
Summary: Item type image does not display for biblio-level itemtypes in list display i...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jared Camins-Esakov
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-29 21:01 UTC by Jared Camins-Esakov
Modified: 2014-05-26 21:04 UTC (History)
3 users (show)

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


Attachments
Bug 9174: Fix itemtype image display in OPAC lists (4.32 KB, patch)
2012-11-29 22:06 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 9174: Fix itemtype image display in OPAC lists (4.43 KB, patch)
2012-12-07 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9174 follow-up: Eliminate warning and fix POD (1.17 KB, patch)
2013-01-01 00:56 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 9174 follow-up: Eliminate warning and fix POD (1.22 KB, patch)
2013-01-01 22:25 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 9174: Fix itemtype image display in OPAC lists (4.54 KB, patch)
2013-01-30 07:55 UTC, Mason James
Details | Diff | Splinter Review
Bug 9174 follow-up: Eliminate warning and fix POD (1.34 KB, patch)
2013-01-30 07:55 UTC, Mason James
Details | Diff | Splinter Review
Bug 9174: [3.8.x] Fix itemtype image display in OPAC lists (4.94 KB, patch)
2013-02-02 07:39 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2012-11-29 21:01:09 UTC
C4::VirtualShelves::Page does not make sure that the itemtype images that it chooses are for the correct interface, so even on the OPAC the Intranet icons are requested.
Comment 1 Jared Camins-Esakov 2012-11-29 22:06:11 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2012-12-07 10:55:39 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2012-12-10 10:57:49 UTC
QA Comment:
Works as expected. Code looks good to me too.
Small sidenote: POD documentation of getitemtypeinfo was copied from getitemtype. Still contains wrong procedure name. You touched that line. Could you correct it when you look at the following point? 

Also note that the second parameter is optional. It is called more often than from lists. If you do not test if $interface is defined, you will create a lot of noise in the logs due to it being uninitialized. See the line with test $interface eq 'opac' in C4/Koha.pm routine getitemtypeinfo.
For the last reason parking this report to Failed QA. Please correct or send a follow-up. Thanks.
Comment 4 Jared Camins-Esakov 2013-01-01 00:56:17 UTC Comment hidden (obsolete)
Comment 5 Chris Cormack 2013-01-01 22:25:20 UTC Comment hidden (obsolete)
Comment 6 Mason James 2013-01-30 07:55:04 UTC Comment hidden (obsolete)
Comment 7 Mason James 2013-01-30 07:55:23 UTC Comment hidden (obsolete)
Comment 8 Mason James 2013-01-30 07:56:35 UTC
(In reply to comment #7)
> Created attachment 14938 [details] [review]
> Bug 9174 follow-up: Eliminate warning and fix POD
> 
> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
> Signed-off-by: Mason James <mtj@kohaaloha.com>

testing 2 commit(s) (applied to f8686e9 'Bug 9116: Remove some useless tmp var')

passing QA, works as expected
Comment 9 Jared Camins-Esakov 2013-01-31 15:58:04 UTC
This patch has been pushed to master.
Comment 10 Chris Cormack 2013-02-02 06:38:22 UTC
Pushed to 3.10.x will be in 3.10.3
Comment 11 Jared Camins-Esakov 2013-02-02 07:39:19 UTC
Created attachment 15022 [details] [review]
Bug 9174: [3.8.x] Fix itemtype image display in OPAC lists

Prior to this patch, C4::VirtualShelves::Page did not make sure that
the itemtype images that it chose when displaying itemtype images for
biblio-level itemtypes were for the correct interface, so
even on the OPAC the Intranet icons were requested. On standard
installations, intranet-tmpl is not available to the OPAC.

To test:
1) Set noItemTypeImages to "Show" and item-level_items to "biblio record"
2) Create a list and add an item with the default item type (942$c in
   MARC21) set to something with an itemtype image associated with it.
3) View the list in the OPAC.
4) If you are an a standard install, the itemtype image will be a broken
   link. If on a dev install, you can confirm with Firebug or the like
   that the image is pulled from /intranet-tmpl.
5) Apply patch.
6) Run `prove t/db_dependent/Koha.t` to confirm that the behavior of the
   routine used to retrieve the image URL is correct. (Note that you
   must have an item type with the code 'BK')
7) Refresh the list, noting that the display is now correct/the image is
   pulled from opac-tmpl.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It works as expected. All tests in Koha.t passed.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:

	t/db_dependent/Koha.t

Squashed with: Bug 9174 follow-up: Eliminate warning and fix POD

Thanks to Marcel for spotting these issues.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Comment 12 Jared Camins-Esakov 2013-02-02 07:40:50 UTC
The attached patch applies to both 3.8.x and 3.6.x, and is needed on both branches.
Comment 13 Chris Cormack 2013-02-03 02:29:12 UTC
Pushed to 3.8.x will be in 3.8.10