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 <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
Jonathan Druart 2016-03-22 09:38:52 +00:00 committed by Brendan Gallagher
parent 44b37f3bc8
commit 6a078fb1b3
1 changed files with 3 additions and 1 deletions

View File

@ -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