Bug 36366

Summary: Itemtype can be used in XSLT
Product: Koha Reporter: Wainui Witika-Park <wainuiwitikapark>
Component: TemplatesAssignee: Wainui Witika-Park <wainuiwitikapark>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: lucas, nick, wainuiwitikapark
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 36366: Itemtype can be used in XSLT
Bug 36366: Itemtype can be used in XSLT
Bug 36366: Itemtype can be used in XSLT

Description Wainui Witika-Park 2024-03-20 04:58:41 UTC
Item types should be able to be called in XSLT
Comment 1 Wainui Witika-Park 2024-03-20 05:07:55 UTC
Created attachment 163488 [details] [review]
Bug 36366: Itemtype can be used in XSLT

Sponsored-by: Catalyst IT
Comment 2 Lucas Gass (lukeg) 2024-03-22 14:47:17 UTC
Wainui,

Can we get a test plan?
Comment 3 Wainui Witika-Park 2024-03-25 02:35:56 UTC
Created attachment 163763 [details] [review]
Bug 36366: Itemtype can be used in XSLT

Test plan:
- Apply patch
- Go to one of the XSLT files e.g. MARC21slim2OPACResults.xsl
- Use $itemtype defined in C4/XSLT.pm e.g. copy how $OPACItemLocation is used in MARC21slim2OPACResults.xsl
- See if the XSLT changes worked e.g. go to search results and see if itemtype is there

Sponsored-by: Catalyst IT
Comment 4 Frédéric Demians 2024-03-25 10:18:40 UTC
Created attachment 163784 [details] [review]
Bug 36366: Itemtype can be used in XSLT

Test plan:
- Apply patch
- Go to one of the XSLT files e.g. MARC21slim2OPACResults.xsl
- Use $itemtype defined in C4/XSLT.pm e.g. copy how $OPACItemLocation is used in MARC21slim2OPACResults.xsl
- See if the XSLT changes worked e.g. go to search results and see if itemtype is there

Sponsored-by: Catalyst IT
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 5 Nick Clemens (kidclamp) 2024-03-29 20:37:44 UTC
I think this should match the format of other information:
 my $itemtype          = C4::Koha::xml_escape($item->effective_itemtype    && exists $itemtypes->{$item->effective_itemtype}            ? $itemtypes->{$item->effective_itemtype}            : $item->effective_itemtype);

Other wise we end up with undef when the effective itemtype is not an official itemtype, and I think we should still display the type code in that case.
Also, we are xml escaping other values, so should on this one too