Closed HugoHvidSorensen closed 2 years ago
We are experiencing the same issue.
@HugoHvidSorensen we are running Linux and having the same issue, so it is not related to Windows.
Traceback (most recent call last):
File "/home/notation/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Dataforsyningen/df_config.py", line 119, in _handle_services_response
self._get_qlr_file()
File "/home/notation/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Dataforsyningen/df_config.py", line 130, in _get_qlr_file
self._load_config_from_cached_df_qlr()
File "/home/notation/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Dataforsyningen/df_config.py", line 158, in _load_config_from_cached_df_qlr
self.background_category, self.categories = self.get_df_categories()
File "/home/notation/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Dataforsyningen/df_config.py", line 173, in get_df_categories
groups_with_layers = self.df_qlr_file.get_groups_with_layers()
File "/home/notation/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Dataforsyningen/qlr_file.py", line 27, in get_groups_with_layers
layers = self.get_group_layers(group)
File "/home/notation/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Dataforsyningen/qlr_file.py", line 45, in get_group_layers
service = self.get_maplayer_service(maplayer_node)
File "/home/notation/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Dataforsyningen/qlr_file.py", line 75, in get_maplayer_service
return service
UnboundLocalError: local variable 'service' referenced before assignment
Fejlen skyldes en kode fejl i modul qlr_file.py. Variabel "service" returneres fra funktion "get_maplayer_service", men i mange tilfælde er den hverken blevet oprettet eller fået tildelt en værdi. Jeg har genereret en "pull-request" i GitHub med en fejlrettelse.
Man kan selv rette fejlen på sin lokale installation af plugin ved at finde fil "qlr_file.py" org rette:
Linjerne 53 - 54 i qlr_file.py kan rettes fra
def get_maplayer_service(self, maplayer_node):
datasource_node = None
Til:
def get_maplayer_service(self, maplayer_node):
datasource_node = None
service = None
hvorved man sikrer sig, at variabel "service" altid er oprettet og værdisat med "None"
Duplicate of #11 and #11 is closed, so this gets closed too.
Plugin fejler og melder en række fejl "Pythonfejl" - startede 2022-01-19 eftermiddag/aften. Plugin fungerer ikke: Python-fejl (profilen er erstattet med "XXX": " 2022-01-20T07:29:39 WARNING Traceback (most recent call last): File "C:\Users/XXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Dataforsyningen\df_config.py", line 154, in _handle_qlr_response self._load_config_from_cached_df_qlr() File "C:\Users/XXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Dataforsyningen\df_config.py", line 158, in _load_config_from_cached_df_qlr self.background_category, self.categories = self.get_df_categories() File "C:\Users/XXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Dataforsyningen\df_config.py", line 173, in get_df_categories groups_with_layers = self.df_qlr_file.get_groups_with_layers() File "C:\Users/XXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Dataforsyningen\qlr_file.py", line 27, in get_groups_with_layers layers = self.get_group_layers(group) File "C:\Users/XXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Dataforsyningen\qlr_file.py", line 45, in get_group_layers service = self.get_maplayer_service(maplayer_node) File "C:\Users/XXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Dataforsyningen\qlr_file.py", line 75, in get_maplayer_service return service UnboundLocalError: local variable 'service' referenced before assignment"
Har problemet på mindst to PCére (opdateret med seneste funktionsopdatering til Windows 10 "21H2" - man ved jo aldrig om det er Microsoft, der har fundet på numre).