From 6a078fb1b34ad9585ccd4c717723dfca2a91df80 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 22 Mar 2016 09:38:52 +0000 Subject: [PATCH] Bug 16114: Koha::ItemType->translated_description should return a string This patch fixes a regression introduce by bug 14828. If an itemtype is translated, its description won't be displayed correctly on the item search form. Koha::ItemType->translated_description is only used once. Test plan: - define a translation for an item type (Administration -> Item types -> Edit -> Translate into other languages) - go on the item search form, the item type should be displayed correctly. QA note: This module is not covered by tests, it seems that I forgot to write them... Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- Koha/ItemType.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm index 99c072852a..48df808dc7 100644 --- a/Koha/ItemType.pm +++ b/Koha/ItemType.pm @@ -57,7 +57,9 @@ sub translated_description { entity => 'itemtypes', lang => $lang })->next; - return $translated_description || $self->description; + return $translated_description + ? $translated_description->translation + : $self->description; } =head3 translated_descriptions -- 2.20.1