Bug 36366 - Itemtype can be used in XSLT
Summary: Itemtype can be used in XSLT
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Wainui Witika-Park
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-20 04:58 UTC by Wainui Witika-Park
Modified: 2024-03-29 20:37 UTC (History)
3 users (show)

See Also:
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 (1.34 KB, patch)
2024-03-20 05:07 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 36366: Itemtype can be used in XSLT (1.62 KB, patch)
2024-03-25 02:35 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 36366: Itemtype can be used in XSLT (1.76 KB, patch)
2024-03-25 10:18 UTC, Frédéric Demians
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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