From 27868d84eb2169b22abc0e1200f5c6636c7a28d1 Mon Sep 17 00:00:00 2001 From: rldhont Date: Fri, 2 Feb 2024 16:07:50 +0100 Subject: [PATCH] [Bugfix] JS - layer in a restricted group is not available It is necessary to check that the layername is available before buidling the attribute table. Layer in a restricted group could be not available. Funded by Entente Valabre --- assets/src/legacy/attributeTable.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/src/legacy/attributeTable.js b/assets/src/legacy/attributeTable.js index fb9212bb98..8e9ecee53b 100644 --- a/assets/src/legacy/attributeTable.js +++ b/assets/src/legacy/attributeTable.js @@ -54,8 +54,14 @@ var lizAttributeTable = function() { var typeName = featureType.getElementsByTagName('Name')[0].textContent; // layername var layername = lizMap.getNameByTypeName( typeName ); - if ( !layername || layername == undefined ) + if ( !layername || layername == undefined ) { continue; + } + // Check layername + // if layer is in a restricted group, the layer wil not be available + if (!lizMap.mainLizmap.state.layersAndGroupsCollection.layerNames.includes(layername)) { + continue; + } // lizmap internal js cleaned name var cleanName = lizMap.cleanName(layername); // lizmap config file layer name