Bugzilla – Attachment 180176 Details for
Bug 38339
Standard backend _get_core_fields are not translatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38339: Preparation: Access value of attribute by its key, not by display label
Bug-38339-Preparation-Access-value-of-attribute-by.patch (text/plain), 2.83 KB, created by
Pedro Amorim
on 2025-04-01 12:54:54 UTC
(
hide
)
Description:
Bug 38339: Preparation: Access value of attribute by its key, not by display label
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-04-01 12:54:54 UTC
Size:
2.83 KB
patch
obsolete
>From 77606fe293552eb433ca0075e950e29d86fb9944 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Tue, 1 Apr 2025 12:14:28 +0000 >Subject: [PATCH] Bug 38339: Preparation: Access value of attribute by its key, > not by display label > >This ensures the value of the intended attribute is displayed, regardless of its translatable description >--- > Koha/ILL/Request.pm | 15 +++++++++++++++ > .../bootstrap/en/modules/opac-illrequests.tt | 4 ++-- > 2 files changed, 17 insertions(+), 2 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index c57400cb03f..5ab32868378 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -1235,6 +1235,21 @@ sub getPrefix { > return $brn_prefixes->{ $params->{branch} } || ""; # "the empty prefix" > } > >+=head3 get_extended_attribute_value >+ >+ my $type = $request->get_extended_attribute_value('title'); >+ >+Return the Koha::ILL::Request::Attribute->value for the requested attribute type >+ >+=cut >+ >+sub get_extended_attribute_value { >+ my ( $self, $type ) = @_; >+ my $attr = $self->extended_attributes->find( { type => $type } ); >+ return if !$attr; >+ return $attr->value; >+} >+ > =head3 get_type > > my $type = $abstract->get_type(); >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 b3a5bfad6c1..1fae11c5823 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >@@ -151,8 +151,8 @@ > [% type = request.get_type %] > <tr> > <td>[% request.id | html %]</td> >- <td> [% IF request.metadata.Author %][% request.metadata.Author | html %][% ELSE %]<span>N/A</span>[% END %] </td> >- <td> [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %] </td> >+ <td> [% IF request.get_extended_attribute_value('author') %][% request.get_extended_attribute_value('author') | html %][% ELSE %]<span>N/A</span>[% END %] </td> >+ <td> [% IF request.get_extended_attribute_value('title') %][% request.get_extended_attribute_value('title') | html %][% ELSE %]<span>N/A</span>[% END %] </td> > <td>[% request.backend | html %]</td> > <td> [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %] </td> > <td>[% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %]</td> >-- >2.39.5
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 38339
:
180155
|
180156
|
180176
|
180177
|
180529
|
181136