diff --git a/Models/ThemeConfig/TagRenderingConfig.ts b/Models/ThemeConfig/TagRenderingConfig.ts index 431080b1b..9881c9abf 100644 --- a/Models/ThemeConfig/TagRenderingConfig.ts +++ b/Models/ThemeConfig/TagRenderingConfig.ts @@ -206,6 +206,11 @@ export default class TagRenderingConfig { } else if (mapping.hideInAnswer !== undefined) { hideInAnswer = TagUtils.Tag(mapping.hideInAnswer, `${context}.mapping[${i}].hideInAnswer`); } + const addExtraTags = (mapping.addExtraTags ?? []).map((str, j) => TagUtils.SimpleTag(str, `${ctx}.addExtraTags[${j}]`)); + if(hideInAnswer === true && addExtraTags.length > 0){ + throw `${ctx}: Invalid mapping: 'hideInAnswer' is set to 'true', but 'addExtraTags' is enabled as well. This means that extra tags will be applied if this mapping is chosen as answer, but it cannot be chosen as answer. This either indicates a thought error or obsolete code that must be removed.` + } + let icon = undefined; let iconClass = "small" if(mapping.icon !== undefined){ @@ -223,7 +228,7 @@ export default class TagRenderingConfig { hideInAnswer, icon, iconClass, - addExtraTags: (mapping.addExtraTags ?? []).map((str, j) => TagUtils.SimpleTag(str, `${ctx}.addExtraTags[${j}]`)) + addExtraTags }; if (this.question) { if (hideInAnswer !== true && mp.if !== undefined && !mp.if.isUsableAsAnswer()) { diff --git a/assets/layers/playground/playground.json b/assets/layers/playground/playground.json index f25f8a401..31dd33268 100644 --- a/assets/layers/playground/playground.json +++ b/assets/layers/playground/playground.json @@ -347,10 +347,7 @@ "fr": "Réservée aux élèves de l’école", "es": "Solo accesibles para estudiantes de la escuela" }, - "hideInAnswer": true, - "addExtraTags": [ - "fee=no" - ] + "hideInAnswer": true }, { "if": "access=private", diff --git a/assets/themes/uk_addresses/uk_addresses.json b/assets/themes/uk_addresses/uk_addresses.json index 7abc1cde1..79351d220 100644 --- a/assets/themes/uk_addresses/uk_addresses.json +++ b/assets/themes/uk_addresses/uk_addresses.json @@ -271,9 +271,6 @@ { "if": "not:addr:unit=yes", "then": "