Currently, the title block supports substitutions but does not support template toolkit syntax. We should add support for parsing TT titles to match the ability to use TT in the main content block of notices.
Created attachment 112020 [details] [review] Bug 26745: Add TT support to 'title' in notices This patch adds support for using TT syntax in the title element of the notices system. Test plan
Created attachment 112021 [details] [review] Bug 26745: Add TT support to 'title' in notices This patch adds support for using TT syntax in the title element of the notices system. Test plan 1/ Edit an easily triggerable email notice such that the title contains some template toolkit markup. Example: Edit the 'CHECKOUT' notice to include [% today %] in the title field. 2/ Trigger the notice (For 'CHECKOUT' that means checking an item out to a user (Preferably with 'email' selected in their advanced messaging preferences for the notice) 3/ Either, navigate to the 'Notices' tab for the user, or run the message queue and inspect the subject line of the recieved email. 4/ Prior to the patch the TT syntax would remain 'as is'.. i.e '[% today %]'. 5/ After the patch, the TT syntax should have been properly replaced. 6/ Signoff
Created attachment 112136 [details] [review] Bug 26745: Add TT support to 'title' in notices This patch adds support for using TT syntax in the title element of the notices system. Test plan 1/ Edit an easily triggerable email notice such that the title contains some template toolkit markup. Example: Edit the 'CHECKOUT' notice to include [% today %] in the title field. 2/ Trigger the notice (For 'CHECKOUT' that means checking an item out to a user (Preferably with 'email' selected in their advanced messaging preferences for the notice) 3/ Either, navigate to the 'Notices' tab for the user, or run the message queue and inspect the subject line of the recieved email. 4/ Prior to the patch the TT syntax would remain 'as is'.. i.e '[% today %]'. 5/ After the patch, the TT syntax should have been properly replaced. 6/ Signoff Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 112178 [details] [review] Bug 26745: Add TT support to 'title' in notices This patch adds support for using TT syntax in the title element of the notices system. Test plan 1/ Edit an easily triggerable email notice such that the title contains some template toolkit markup. Example: Edit the 'CHECKOUT' notice to include [% today %] in the title field. 2/ Trigger the notice (For 'CHECKOUT' that means checking an item out to a user (Preferably with 'email' selected in their advanced messaging preferences for the notice) 3/ Either, navigate to the 'Notices' tab for the user, or run the message queue and inspect the subject line of the recieved email. 4/ Prior to the patch the TT syntax would remain 'as is'.. i.e '[% today %]'. 5/ After the patch, the TT syntax should have been properly replaced. 6/ Signoff Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Please add a test for that.
Created attachment 112983 [details] [review] Bug 26745: (QA follow-up) Add Unit Tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pushed to master for 20.11, thanks to everybody involved!
A very unintentional side-effect of this patch has been to caught a bug in SendAlerts, see bug 26935. # Failed test 'SendAlerts - claimissue' # at t/db_dependent/Letters.t line 642. C4::Letters::_substitute_tables(): DBI Exception: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed [for Statement "SELECT * FROM aqbasket WHERE basketno = ?" with ParamValues: 0=53] at /kohadevbox/koha/C4/Letters.pm line 679
(In reply to Jonathan Druart from comment #8) > A very unintentional side-effect of this patch has been to caught a bug in > SendAlerts, see bug 26935. > > # Failed test 'SendAlerts - claimissue' > # at t/db_dependent/Letters.t line 642. > C4::Letters::_substitute_tables(): DBI Exception: DBD::mysql::st execute > failed: called with 2 bind variables when 1 are needed [for Statement > "SELECT * FROM aqbasket WHERE basketno = ?" with ParamValues: 0=53] at > /kohadevbox/koha/C4/Letters.pm line 679 This comment was for bug 21898.
enhancement will not be backported to 20.05.x