Bugzilla – Attachment 150302 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.29 KB, created by
Kyle M Hall (khall)
on 2023-04-27 14:32:33 UTC
(
hide
)
Description:
Bug 32453: Allow template access to _result/_resultset
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-04-27 14:32:33 UTC
Size:
1.29 KB
patch
obsolete
>From eefe09826cd0b15fe3f56f289ed9e9c0d5558761 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! >--- > C4/Templates.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/C4/Templates.pm b/C4/Templates.pm >index dd54a6e3f41..594f39cf72c 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