I had something like this in a notice: <!-- [% table.unkown_field %] --> The table is linked to a valid Koha object. The field is wrong. Running Print slip from within circ/article-requests caused a crash like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::<<TABLE>>-><<UNKNOWN_FIELD>> is not covered by tests! While this is within a comment, I did not hope to see that.
(In reply to Marcel de Rooy from comment #0) > Running Print slip from within circ/article-requests caused a crash like: Yes it was article_requests.toc_request :)
(In reply to Marcel de Rooy from comment #1) > (In reply to Marcel de Rooy from comment #0) > > Running Print slip from within circ/article-requests caused a crash like: > > Yes it was article_requests.toc_request :) And not present in that database. But it just serves as an example that fields within comments are evaluated.
As a side note (lowering the severity a bit): You could also try [%# bad stuff %], this works at least partially as long as the bad stuff does not contain %] which would end the comment. And for fun, as a crazy workaround, you could replace an ending %] by %][%# resulting in for instance: [%# <p>TOC: [% IF article_request.toc_request %][%#<strong>Include TOC</strong>[% ELSE %][%#No[% END %] It works, but serves as a 'good' example of a bad workaround. Should we call this a Template Toolkit bug or what?
I think if you use HTML comments, it will still get parsed by TT and that is intentional. It allows you to put things into the templates that are only visible in source, like maybe our TEMPLATE FILE comment in the OPAC. You would have to use a TT comment if you didn't want it to show up in the code/being parsed at all. I believe this is not a bug, but working as intended.