[Bug 27334] New: Add Template Toolkit support to news items
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Bug ID: 27334 Summary: Add Template Toolkit support to news items Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org It would be useful if news items could take advantage of template toolkit syntax. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 114808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114808&action=edit Bug 27334: Add Template Toolkit support to news items It would be useful if news items could take advantage of template toolkit syntax. Test Plan: 1) Apply this patch 2) Edit a news item 3) Add some TT to the content like "[% IF 1 %]It works![% END %]" 4) View the rendered news item on mainpage.pl 5) Note the TT is rendered correctly! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |sally.healey@cheshireshared | |services.gov.uk --- Comment #2 from Sally <sally.healey@cheshiresharedservices.gov.uk> --- This patch won't apply to a sandbox - it gives a series of errors such as: String found where operator expected at /kohadevbox/koha/C4/NewsChannels.pm line 234, near "croak "ERROR PROCESSING TEMPLATE: "" (Do you need to predeclare croak?) syntax error at /kohadevbox/koha/C4/NewsChannels.pm line 234, near "croak "ERROR PROCESSING TEMPLATE: "" Compilation failed in require at /kohadevbox/koha/C4/Members.pm line 36. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114808|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 115309 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115309&action=edit Bug 27334: Add Template Toolkit support to news items It would be useful if news items could take advantage of template toolkit syntax. Test Plan: 1) Apply this patch 2) Edit a news item 3) Add some TT to the content like "[% IF 1 %]It works![% END %]" 4) View the rendered news item on mainpage.pl 5) Note the TT is rendered correctly! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115309|0 |1 is obsolete| | --- Comment #4 from PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> --- Created attachment 115310 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115310&action=edit Bug 27334: Add Template Toolkit support to news items It would be useful if news items could take advantage of template toolkit syntax. Test Plan: 1) Apply this patch 2) Edit a news item 3) Add some TT to the content like "[% IF 1 %]It works![% END %]" 4) View the rendered news item on mainpage.pl 5) Note the TT is rendered correctly! Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #5 from Sally <sally.healey@cheshiresharedservices.gov.uk> --- Works as described - nice addition! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22544 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It works as described, but as this changes a C4 module we should have some unit tests! As we are currently working on moving this code to the Koha namespace (bug 22544) adding new features might be a bit bad timing. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 116159 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116159&action=edit Bug 27334: Add unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Manual, | |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115310|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116467 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116467&action=edit Bug 27334: Add Template Toolkit support to news items It would be useful if news items could take advantage of template toolkit syntax. Test Plan: 1) Apply this patch 2) Edit a news item 3) Add some TT to the content like "[% IF 1 %]It works![% END %]" 4) View the rendered news item on mainpage.pl 5) Note the TT is rendered correctly! Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #116159|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116468&action=edit Bug 27334: Add unit test Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Please fill the release notes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch adds support for release notes| |using Template Toolkit | |markup in news items in the | |same way we can currently | |use it in slips and | |notices. For example, a | |particular part of a news | |item could be show a | |different block of text | |depending on if a certain | |system preference is | |enabled or not. It allows | |supports the use of Koha's | |TT plugins for data and | |price formatting and more! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26663 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Kyle, can you detail a bit more the need please? "It allows supports the use of Koha's TT plugins for data and price formatting and more!" Which "data"? And what "more"? :) Seems overkilled for price formatting only. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #11)
Kyle, can you detail a bit more the need please?
"It allows supports the use of Koha's TT plugins for data and price formatting and more!"
Which "data"? And what "more"? :)
Seems overkilled for price formatting only.
Those are just basic examples. A good example would be a news item that shows different information to libraries based on what category they are. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Kyle M Hall from comment #12)
(In reply to Jonathan Druart from comment #11)
Kyle, can you detail a bit more the need please?
"It allows supports the use of Koha's TT plugins for data and price formatting and more!"
Which "data"? And what "more"? :)
Seems overkilled for price formatting only.
Those are just basic examples. A good example would be a news item that shows different information to libraries based on what category they are.
Logged-in patron's category you mean? How would you do that? We don't pass any variables to ->process. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Passed QA --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #13)
(In reply to Kyle M Hall from comment #12)
(In reply to Jonathan Druart from comment #11)
Kyle, can you detail a bit more the need please?
"It allows supports the use of Koha's TT plugins for data and price formatting and more!"
Which "data"? And what "more"? :)
Seems overkilled for price formatting only.
Those are just basic examples. A good example would be a news item that shows different information to libraries based on what category they are.
Logged-in patron's category you mean? How would you do that? We don't pass any variables to ->process.
My bad, I was thinking the logged in branch code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- So you don't need that, you can define several "item news" and set a different library for each of them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #15)
So you don't need that, you can define several "item news" and set a different library for each of them.
That was just an example. The real power here is combining new with running perl in TT so we have access to any data in Koha. What would make this much better and more convenient is the ability to get a schema object via a TT plugin. That way we can get to the data without resorting to raw perl. What do you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, wondering... if we could get any object, wouldn't that allow to get around permissions like the ones to access patron data? (might be totally misunderstanding things) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #18 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #17)
Hm, wondering... if we could get any object, wouldn't that allow to get around permissions like the ones to access patron data? (might be totally misunderstanding things)
Yes, it would allow you to get around permissions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #19 from David Cook <dcook@prosentient.com.au> --- (In reply to Kyle M Hall from comment #16)
That was just an example. The real power here is combining new with running perl in TT so we have access to any data in Koha. What would make this much better and more convenient is the ability to get a schema object via a TT plugin. That way we can get to the data without resorting to raw perl. What do you think?
This sounds like it might be convenient for a developer but what staff interface user would actually have the knowledge or skill to make use of this? What's your current/expected use cases? It seems a bit too hypothetical to me at the moment. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Still not convinced and there are pending questions. Setting back to in discussion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Bug 24865 highlights a good use case for this, though I feel we should probably limit the data we allow users to fetch using it similar to the notices.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #22 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I'd love to see this picked back up again. I feel like a fair few things are now going into 'Notices and Slips' inappropriately as a workaround to the lack of template processing options here, and I'd rather see simple template support with a small number of globally available variables passed here and for Notices and Slips to focus more on their core purpose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=40659 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #23 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Martin Renvoize (ashimema) from comment #22)
I'd love to see this picked back up again. I feel like a fair few things are now going into 'Notices and Slips' inappropriately as a workaround to the lack of template processing options here, and I'd rather see simple template support with a small number of globally available variables passed here and for Notices and Slips to focus more on their core purpose.
I think notice/slips is where things that require template processing should live. We do need to rename it, see Bug 36525. Do we need 2 systems for template processing? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #24 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- I have also filed Bug 41064. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40659 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40659 [Bug 40659] Allow "My virtual card" format and content to be customizable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|40659 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40659 [Bug 40659] Allow "My virtual card" format and content to be customizable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40659 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40659 [Bug 40659] Allow "My virtual card" format and content to be customizable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|40659 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40659 [Bug 40659] Allow "My virtual card" format and content to be customizable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27334 --- Comment #25 from David Cook <dcook@prosentient.com.au> --- Another wrinkle with this one is that Template Toolkit syntax and WYSIWYGs do not play well together. For more info take a look at bug 11583. If you're using Template Toolkit syntax you'd need to use the text editor and never look at it again with the WYSIWYG or it would potentially break it. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org