Bugzilla – Attachment 80130 Details for
Bug 20941
Displaying requests does not display request material type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20941: (QA follow-up) Fix return value of get_type, make templates more consistant
Bug-20941-QA-follow-up-Fix-return-value-of-gettype.patch (text/plain), 4.54 KB, created by
Katrin Fischer
on 2018-10-05 15:14:03 UTC
(
hide
)
Description:
Bug 20941: (QA follow-up) Fix return value of get_type, make templates more consistant
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-10-05 15:14:03 UTC
Size:
4.54 KB
patch
obsolete
>From 5b7f35bfb31838cd7b57d7d430d8ea620e724aaf Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Thu, 4 Oct 2018 07:44:53 +0000 >Subject: [PATCH] Bug 20941: (QA follow-up) Fix return value of get_type, make > templates more consistant > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > Koha/Illrequest.pm | 3 ++- > koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 6 +++--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt | 4 ++-- > t/db_dependent/Illrequests.t | 4 ++-- > 4 files changed, 9 insertions(+), 8 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index b64b143..3171f14 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -747,7 +747,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 aaa3ed0..f2461ae 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 >@@ -462,7 +462,7 @@ > </li> > <li class="medium"> > <label class="medium">Request type:</label> >- [% type ? type : 'N/A' | html %] >+ [% type || 'N/A' | html %] > </li> > <li class="cost"> > <label class="cost">Cost:</label> >@@ -571,8 +571,8 @@ > </div> > <div class="medium"> > <span class="label medium">Request type:</span> >- [% type = request.get_type %] >- [% type ? type : 'N/A' | html %] >+ % type = request.get_type %] >+ [% type || 'N/A' | html %] > </div> > <div class="cost"> > <span class="label cost">Cost:</span> >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 4f4aa84..cf272fe 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >@@ -135,7 +135,7 @@ > [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %] > </td> > <td>[% request.backend | html %]</td> >- <td>[% type ? type : '<span>N/A</span>' | html %]</td> >+ <td>[% type || 'N/A' | html %]</td> > <td>[% request.capabilities.$status.name | html %]</td> > <td>[% request.placed | html %]</td> > <td>[% request.updated | html %]</td> >@@ -179,7 +179,7 @@ > </li> > <li> > <label for="medium">Request type:</label> >- [% type ? type : '<span>N/A</span>' | html %] >+ [% type || 'N/A' | html %] > </li> > <li> > <label for="placed">Request placed:</label> >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index 97df6d8..523dedb 100644 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -83,8 +83,8 @@ subtest 'Basic object tests' => sub { > is($illrq_obj->backend, $illrq->{backend}, > "Backend getter works."); > >- is($illrq_obj->get_type, '<span>N/A</span>', >- '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 => { >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20941
:
76052
|
79577
|
79825
|
79865
|
79918
|
79919
|
79920
|
79921
|
79945
|
79999
|
80112
|
80113
|
80114
|
80115
|
80116
|
80117
|
80127
|
80128
|
80129
|
80130
|
80131
|
80132
|
80212
|
81688
|
81689
|
81690
|
81691
|
81692
|
81693
|
81694