From d8d32f07273df0b71a026faed5c548ad5ca5f7e1 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... --- Koha/ItemType.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm index 99c0728..48df808 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.7.0