Bug 7270

Summary: Removing double itemtype on shelve contents page when no icon is shown
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: ListsAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: minor    
Priority: PATCH-Sent (DO NOT USE) CC: chris, paul.poulain
Version: 3.6   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Patch
Revised patch
Revised patch
Revised patch
Bug 7270: Removing double itemtype on shelve contents page when no icon is shown

Description Marcel de Rooy 2011-11-28 12:36:56 UTC
The intranet shelves page lists the itemtype twice if no icon is shown. (The alternate text is repeated by the same type description.)
Patch with simple template change forthcoming.
Comment 1 Marcel de Rooy 2011-11-28 13:01:35 UTC
Patch also fills noItemTypeImages for the template; it was not initialized in the script.

Test this patch by double clicking a list name in Staff client/Lists.
Before this patch you see a double item type description in the table.
After this patch, depending on the value of pref noItemTypeImages you will see either an icon or a single description. (Check it by toggling that value. Note that you may have to add icons to your itemtypes in Administration.)
Comment 2 Marcel de Rooy 2011-11-28 13:03:12 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2011-11-28 14:08:29 UTC
I'm assuming item-level itemtypes must be disabled in order for this bug to manifest?

I can see three situations where one might see a broken itemtype image (with item-level itemtypes disabled):

1. The title has no biblio-level itemtype set.
2. The itemtype is set but it has no image specified.
3. The itemtype has a remote image specified and the remote image doesn't exist.

1 & 2 can be solved by wrapping the <img> tag in a check for imageurl

3 might be solved by this patch but I think it's a rare enough case that we shouldn't implement the fix proposed here because it removes the output of the description along with the image. As far as I know that is the intention of the way the templates have been set up here and elsewhere. To change that I think we need a wider discussion.
Comment 4 Marcel de Rooy 2011-11-28 14:13:00 UTC
Owen,
It solved your second case.
Furthermore it was built on the assumption that you do not need the text if the image is displayed. But you do?
To resolve, I will revise with a check on url.
Comment 5 Owen Leonard 2011-11-28 14:28:07 UTC
(In reply to comment #4)
> Furthermore it was built on the assumption that you do not need the text if the
> image is displayed. But you do?

In this case and in other places in the templates it is designed so that image and text will appear together. Whether or not this *should* be the way it is done could be the subject of a mailing list discussion, but for now I think we should keep things consistent.
Comment 6 Marcel de Rooy 2011-11-28 14:35:20 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2011-11-30 15:40:13 UTC
The noItemTypeImages variable is already filled in Auth.pm.
Comment 8 Marcel de Rooy 2011-11-30 15:49:28 UTC Comment hidden (obsolete)
Comment 9 Marcel de Rooy 2011-11-30 15:50:55 UTC Comment hidden (obsolete)
Comment 10 Chris Cormack 2011-12-01 08:27:04 UTC
Created attachment 6485 [details] [review]
Bug 7270: Removing double itemtype on shelve contents page when no icon is shown

Just adding a check on imageurl in the template.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 11 Paul Poulain 2011-12-14 17:03:18 UTC
QA comment : small (1 line) patch, nothing more to say

(comment 1 and 3 usefull to understand test cases)

Patch pushed, please test