From 4e091ae9435bb571a001e61bc8fad6c99096bb15 Mon Sep 17 00:00:00 2001 From: Pascal Barth Date: Tue, 26 Nov 2024 13:31:08 +0100 Subject: [PATCH] PB-1211 : do not add ; if layer with feature selection is alone When opening the app with a layerId=featureId URL param, the ; was still added to the layers URL param after processing the feature pre-selection. This means the layers URL param was malformed and an error showed up. --- src/utils/legacyLayerParamUtils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/legacyLayerParamUtils.js b/src/utils/legacyLayerParamUtils.js index e6adbd36b..fcf493ee5 100644 --- a/src/utils/legacyLayerParamUtils.js +++ b/src/utils/legacyLayerParamUtils.js @@ -243,7 +243,10 @@ export function handleLegacyFeaturePreSelectionParam(params, store, newQuery) { // if there are no layers parameters at all, we need to create one newQuery.layers = '' } - newQuery.layers += `;${layerId}@features=${featuresIds.split(',').join(':')}` + if (newQuery.layers.length > 0) { + newQuery.layers += ';' + } + newQuery.layers += `${layerId}@features=${featuresIds.split(',').join(':')}` } }) }