From 63caa02ceac3afb5381f54afab2e4dc7e10910d8 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Tue, 19 Feb 2019 15:48:50 -0500 Subject: [PATCH] Allow presets to inherit multiCombo and semiCombo fields even if they define the preset --- modules/presets/preset.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/presets/preset.js b/modules/presets/preset.js index 61e251b9d..a35796163 100644 --- a/modules/presets/preset.js +++ b/modules/presets/preset.js @@ -25,10 +25,14 @@ export function presetPreset(id, preset, fields, visible, rawPresets) { // Skip `fields` for the keys which define the preset. // These are usually `typeCombo` fields like `shop=*` - function withoutKeyFields(fieldID) { + function shouldInheritFieldWithID(fieldID) { var f = fields[fieldID]; if (f.key) { - return preset.tags[f.key] === undefined; + if (preset.tags[f.key] !== undefined && + // inherit anyway if multiple values are allowed + f.type !== 'multiCombo' && f.type !== 'semiCombo') { + return false; + } } return true; } @@ -43,7 +47,7 @@ export function presetPreset(id, preset, fields, visible, rawPresets) { var inheritFieldIDs = inheritPreset[prop] || []; if (prop === 'fields') { - inheritFieldIDs = inheritFieldIDs.filter(withoutKeyFields); + inheritFieldIDs = inheritFieldIDs.filter(shouldInheritFieldWithID); } return inheritFieldIDs;