https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=3150
Jonathan Druart <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] | |ommunity.org --- Comment #12 from Jonathan Druart <[email protected]> --- Hello Aleisha, This is a very interesting part to move to the notice templates! However I am expecting it to be tricky, as you saw already :) Before starting to implement anything I would suggest you to come with a plan. I can provide you early feedback to see if we are starting with the best solution. In my opinion we should only pass Koha::Objects-based variables to the template. Reusing the existing variables will make us start with obsolete code (it will be harder to improve it in the future as the libraries will have this TT code in their templates). (In reply to Katrin Fischer from comment #11) > Could we imagine replacing the old subroutines by a more generic approach of > accessing the information in the MARC record instead of moving them? > > Thinking of something like: > > [% record.245a %] Says we are talking about GetMarcUrls, it could be something like: [% SET marc_record = biblio.metadata.record %] [% FOR f IN marc_record.field('856') %] [%# Then do something for every 856 field [% END %] But then you are going to rewrite the code that is in a subroutine to a TT syntax, that will be copy/pasted in different places. And it's not what we want, it's too error prone (no test coverage, dup of code). The only long term and viable solution is to move them to the Koha namespace. Have the Get* subroutines moved to Koha::Biblio methods, have the test coverage, replace the existing occurrences, and finally reuse them from the template notices. But this task is huge... -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
