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.
Created attachment 13791 [details] [review] Bug 9174: 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.
Created attachment 13911 [details] [review] Bug 9174: 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.
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.
Created attachment 14347 [details] [review] Bug 9174 follow-up: Eliminate warning and fix POD Thanks to Marcel for spotting these issues.
Created attachment 14351 [details] [review] 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>
Created attachment 14937 [details] [review] Bug 9174: 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>
Created attachment 14938 [details] [review] 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>
(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
This patch has been pushed to master.
Pushed to 3.10.x will be in 3.10.3
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>
The attached patch applies to both 3.8.x and 3.6.x, and is needed on both branches.
Pushed to 3.8.x will be in 3.8.10