Summary: | Add template toolkit function to get arbitrary Koha::Objects | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | Templates | Assignee: | Kyle M Hall (khall) <kyle> |
Status: | Failed QA --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | julian.maurice, lucas, pedro.amorim |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 36654: Add template toolkit function to get arbitrary Koha::Objects
Bug 36654: Add template toolkit function to get arbitrary Koha::Objects Bug 36654: Add template toolkit function to get arbitrary Koha::Objects |
Description
Kyle M Hall (khall)
2024-04-19 18:25:44 UTC
In particular, the data for overdues is difficult to access. Created attachment 165227 [details] [review] Bug 36654: Add template toolkit function to get arbitrary Koha::Objects A lot of older notice data include identifiers but not the objects themselves. We should have a helper TT plugin to make getting those objects easy. Test Plan: 1) prove t/db_dependent/Koha/Template/Plugin/Koha.t 2) Set the CHECKOUT notice to: [% USE Koha %] [% SET b = Koha.GetObjectById('Koha::Biblios', b.biblionumber ); [% b.title %] 3) Note the notice contains the checkout title Created attachment 166293 [details] [review] Bug 36654: Add template toolkit function to get arbitrary Koha::Objects A lot of older notice data include identifiers but not the objects themselves. We should have a helper TT plugin to make getting those objects easy. Test Plan: 1) prove t/db_dependent/Koha/Template/Plugin/Koha.t 2) Set the CHECKOUT notice to: [% USE Koha %] [% SET b = Koha.GetObjectById('Koha::Biblios', bblio.biblionumber ); %] [% b.title %] 3) Note the notice contains the checkout title Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Created attachment 166294 [details] [review] Bug 36654: Add template toolkit function to get arbitrary Koha::Objects A lot of older notice data include identifiers but not the objects themselves. We should have a helper TT plugin to make getting those objects easy. Test Plan: 1) prove t/db_dependent/Koha/Template/Plugin/Koha.t 2) Set the CHECKOUT notice to: [% USE Koha %] [% SET b = Koha.GetObjectById('Koha::Biblios', biblio.biblionumber ); %] [% b.title %] 3) Note the notice contains the checkout title Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> I think this has security implications as anyone with "edit_notices" permission could fetch any object from the database. In the CHECKOUT notice the biblio object is available so the example given could be rewritten simply as: [% biblio.title %] Can you provide another example where GetObjectById would be required ? |