3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
260 stars 143 forks source link

[Bug]: DataViz fail when layer is in group hidden #4213

Open nworr opened 9 months ago

nworr commented 9 months ago

What is the bug?

When dataviz use a layer which is in the group "hidden", an error is thrown 'The layer name "foo" is unknown!'

Stack Trace

    getMapLayerByName MapLayer.js:466
    setPlotContainerVisibilityFromLayerVisibility dataviz.js:729
    getPlots dataviz.js:140
    uicreated dataviz.js:766

Steps to reproduce the issue

Use a hidden layer for dataviz

Versions, safeguards, check summary etc

Lizmap 3.7.3

Check Lizmap plugin

Operating system

whatever

Browsers

Firefox

Browsers version

122

Relevant log output

getMapLayerByName MapLayer.js:466
 setPlotContainerVisibilityFromLayerVisibility dataviz.js:729
 getPlots dataviz.js:140
 uicreated dataviz.js:766
ygorigor commented 9 months ago

It's because all layers from hidden group are missing from layers tree.