diff --git a/Koha/Template/Plugin/Categories.pm b/Koha/Template/Plugin/Categories.pm index fe8b0d74d9..acd94fb299 100644 --- a/Koha/Template/Plugin/Categories.pm +++ b/Koha/Template/Plugin/Categories.pm @@ -21,15 +21,12 @@ use Template::Plugin; use base qw( Template::Plugin ); use C4::Category; -use Koha::Database; +use Koha::Patron::Categories; sub GetName { my ( $self, $categorycode ) = @_; - my $schema = Koha::Database->new->schema; - return $schema->resultset( 'Category' )->search( { - categorycode => $categorycode, - } )->get_column( 'description' )->next // ''; + return Koha::Patron::Categories->find( $categorycode )->description; } sub all { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index a3d152be49..a2d03156a3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -128,10 +128,10 @@ Library card number: [% IF borrower %] + [% borrower.cardnumber %] + [% ELSE %] [% IF mandatory.defined('cardnumber') %]Required[% END %] - [% ELSE %] - [% borrower.cardnumber %] [% END %] [% END %] @@ -170,6 +170,8 @@ Category: [% IF borrower %] + [% Categories.GetName( borrower.categorycode ) %] + [% ELSE %] - [% ELSE %] - [% Categories.GetName( borrower.categorycode ) %] [% END %] [% END %]