[Koha-bugs] [Bug 36297] Avoid using var named "t" in templates

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 15 12:27:55 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36297

--- Comment #5 from Kyle M Hall <kyle at bywatersolutions.com> ---
(In reply to Julian Maurice from comment #4)
> Remember that there is also 'tn', 'tnx', ... (exhaustive list in i18n.inc).
> 
> Also FOREACH is probably not the only way to "hide" these macros (for
> instance [% t = ... %] or [% WHILE (t = ...) %] probably does the same thing)
> 
> Another solution could be to remove i18n.inc, forcing us to use [%
> I18N.t("...") %] which is unlikely to conflict with other variables.
> 
> Or another (but hypothetical as I'm not sure it works): redefine these
> functions as filters [% "..." | t %] (I believe filters don't conflict with
> variable names ?)

Further testing leads me to believe that you are correct that filters do not
overwrite variable when they have matching names!

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list