A lot of older notice data includes ids but not the objects themselves. We should have a helper TT plugin to make getting those objects easy.
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 ?