diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm
index 0ce24d2b32..4dc64aefe5 100644
--- a/Koha/Illrequest.pm
+++ b/Koha/Illrequest.pm
@@ -748,7 +748,8 @@ Return a string representing the material type of this request or undef
sub get_type {
my ($self) = @_;
my $attr = $self->illrequestattributes->find({ type => 'type'});
- return $attr ? $attr->value : undef;
+ return if !$attr;
+ return $attr->value;
};
#### Illrequests Imports
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
index 63d5ae212f..7c32678d55 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
@@ -450,7 +450,7 @@
@@ -559,8 +559,8 @@
Request type:
- [% type = request.get_type %]
- [% type ? type : 'N/A' | html %]
+ % type = request.get_type %]
+ [% type || 'N/A' | html %]
Cost:
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt
index 4374bfcd4f..f92e350bb9 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt
@@ -136,7 +136,7 @@
[% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]N/A[% END %]
[% request.backend | html %] |
- [% type ? type : 'N/A' | html %] |
+ [% type || 'N/A' | html %] |
[% request.capabilities.$status.name | html %] |
[% request.placed | $KohaDates %] |
[% request.updated | $KohaDates %] |
@@ -180,7 +180,7 @@
- [% type ? type : 'N/A' | html %]
+ [% type || 'N/A' | html %]
diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t
index 13bba7d3a3..1411eace31 100644
--- a/t/db_dependent/Illrequests.t
+++ b/t/db_dependent/Illrequests.t
@@ -85,8 +85,8 @@ subtest 'Basic object tests' => sub {
is($illrq_obj->backend, $illrq->{backend},
"Backend getter works.");
- is($illrq_obj->get_type, 'N/A',
- 'get_type() returns placeholder if no type is set');
+ is($illrq_obj->get_type, undef,
+ 'get_type() returns undef if no type is set');
$builder->build({
source => 'Illrequestattribute',
value => {