Bugzilla – Attachment 150310 Details for
Bug 32453
Object methods _result and _resultset methods not available in templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32453: Allow template access to _result/_resultset
Bug-32453-Allow-template-access-to-resultresultset.patch (text/plain), 1.35 KB, created by
Lucas Gass (lukeg)
on 2023-04-27 16:49:37 UTC
(
hide
)
Description:
Bug 32453: Allow template access to _result/_resultset
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-04-27 16:49:37 UTC
Size:
1.35 KB
patch
obsolete
>From ebdc3e8b5ab615012884ccd2ab47e717056a49b4 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 27 Apr 2023 10:28:50 -0400 >Subject: [PATCH] Bug 32453: Allow template access to _result/_resultset > >There are times where it would be really useful to be able to access the underying result or resultset within out templates. However, Template Toolkit itself disallows this, but you can disable this feature by setting the $Template::Stash::PRIVATE package variable to a false value. > >Test Plan: >1) Modify the CHECKOUT notice, add "*[% biblio._result %]*" to your > notice >2) Generate a CHECKOUT notice, note you only get "**" >3) Apply this patch >4) Restart all the things! >5) Generate a CHECKOUT notice, note you know get something like > "*Koha::Schema::Result::Biblio=HASH(0x564f907a3390*" in your notice! > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > C4/Templates.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/C4/Templates.pm b/C4/Templates.pm >index dd54a6e3f4..594f39cf72 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -74,6 +74,9 @@ sub new { > ENCODING => 'UTF-8', > } > ) or die Template->error(); >+ >+ $Template::Stash::PRIVATE = undef; ## Enable access to private methods like _result/_resultset >+ > my $self = { > TEMPLATE => $template, > VARS => {}, >-- >2.30.2
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 32453
:
150302
| 150310