Unchecked checkbox is falsy but also truthy

Hi,
I have setup a Tenant variable template called #{Tenant.EnableCDN} which is of control type checkbox and defaulting to True.
My web.config transform is configured as follows with Substitute variables in files enabled:

#{if Tenant.EnableCDN}



#{/unless}
#{unless Tenant.EnableCDN}



#{/unless}

If the tenant’s checkbox is checked as I would expect only the if fires.
However if unchecked both the if and unless fire. I would have thought that only the unless would have.

Is this a bug or have I configured it incorrectly?

Thanks,
Matt

Hi Matt,

Thanks for getting in touch! I think the problem lies in the closing statement of the first block. It is #{/unless} instead of '#{/if}`.

Please try that change if let me know if it still does not work as expected.

Regards

Robert W

Notice:

This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.