Univention Bugzilla – Bug 32654
API: extend @%@ syntax to include default value and/or True/False handling
Last modified: 2020-06-22 17:14:03 CEST
May template files use the easier @%@ UCR syntax to reference a UCR variable, which often breaks the syntax when the variable is unset. Because of that the Python-variant using @!@ is used in many cases, because there unset variables can be handled better. This is a lot more complicated, error prone and also requires a fork of a Python process for each @!@ block (see bug #29484). @%@ should be extended to allow some more output handling, e.g. @%@foo?bar@%@ Print content of UCRV $foo or fallback to string literal 'bar'. @%@foo?n?True=y@%@ @%@foo?n?False=y@%@ Use is_true() and is_false() and either print 'y' or 'n'. '?' and '=' are good candidates, since UCRV names can't contains those two characters. Together with UCRV types (Bug #8768) this could be even improved further for list handling.
Bug #19768 and Bug #31606 would benefit from this.
See Bug #38938 for an alternative for default handling