3liz / lizmap-plugin

Lizmap plugin for QGIS, allowing to publish QGIS maps to Lizmap Web Client
https://www.lizmap.com/
GNU General Public License v2.0
61 stars 30 forks source link

'QgsLayerTreeNode' object has no attribute 'layerId' #528

Closed nrohnie closed 7 months ago

nrohnie commented 8 months ago

What is the bug?

After creating sqllite database, import Edigeo and Majics data, a error appear when clicking on Lizmap :

AttributeError: 'QgsLayerTreeNode' object has no attribute 'layerId'

Steps to reproduce the issue

  1. QGis Deskop
  2. Internet
  3. Lizmap
  4. => The error occur....

Versions

Versions :

Check Lizmap plugin

QGIS server version, only if the section above doesn't mention the QGIS Server version

No response

Operating system

Linux Mint 21 Vanessa

Browsers

Chrome

Browsers version

Version 119.0.6045.123

Relevant log output

Une erreur est survenue lors de l'éxécution du code Python: 

AttributeError: 'QgsLayerTreeNode' object has no attribute 'layerId' 
Traceback (most recent call last):
  File "/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lizmap/plugin.py", line 3645, in save_cfg_file
    ogc_projet_validity.add_shortnames()
  File "/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lizmap/ogc_project_validity.py", line 35, in add_shortnames
    existing, duplicated = self.existing_shortnames()
  File "/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lizmap/ogc_project_validity.py", line 68, in existing_shortnames
    existing = self._read_all_shortnames(layer_tree, [])
  File "/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lizmap/ogc_project_validity.py", line 89, in _read_all_shortnames
    self._read_all_shortnames(child, existing_shortnames)
  File "/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lizmap/ogc_project_validity.py", line 81, in _read_all_shortnames
    layer = self.project.mapLayer(child.layerId())
AttributeError: 'QgsLayerTreeNode' object has no attribute 'layerId'

Version de Python : 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] 
Version de QGIS : 3.22.4-Białowieża Białowieża, exported 

Chemin Python :
/usr/share/qgis/python
/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python
/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages
/usr/lib/python3.10/dist-packages
/home/stephan/.local/share/QGIS/QGIS3/profiles/default/python
/home/stephan/lizmap/custom_repository
Gustry commented 8 months ago

This issue is in the wrong GitHub repository.

Gustry commented 7 months ago

Can you try this ZIP ?

lizmap.4.0.2-alpha.zip

QGIS Deskop → QGIS plugin manager → Install from ZIP

Thanks

nrohnie commented 7 months ago

We change both server an client for QGIS 3.34... And the Qgis client side work better...