It is hard for me to describe this problem, so I made a simple (and useless) example to describe this problem.
Suppose I do have a template named "Template:A" with the content:
{{void{{<includeonly>safesubst:</includeonly>!}}param=any}}
If I call this template with {{subst:A}} everything works as expected, since {{!}} is expanded and the generated "|" is treated as a parameter separator, so "Template:void" is called with "param=any" as parameter. So far so good.
But, if I call this template with {{A}}, the {{!}} is expanded as literal "|" and the "Template:void|param=any" is called without parameters, which is an error.
I do not know exactly how to workaround this issue (maybe some trick I do not know).
As I stated before, this is just a minimal example, because what I really intend to do is to pass a parameter to another template only when one condition is satisfied, but I am not able to made it work when the template is both substituted or transcluded.
Version: unspecified
Severity: normal