Skip to content

Commit

Permalink
Fix wrong popup when the layer has a shortname, improve some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Apr 29, 2024
1 parent 90ef44e commit ee5b205
Show file tree
Hide file tree
Showing 6 changed files with 2,658 additions and 562 deletions.
2 changes: 1 addition & 1 deletion lizmap_server/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def find_vector_layer(layer_name: str, project: QgsProject) -> Union[None, QgsVe
return layer

Logger.warning(
"The vector layer {} has not been found in the project {}".format(layer_name, project.fileName()))
"The vector layer '{}' has not been found in the project '{}'".format(layer_name, project.fileName()))
return None


Expand Down
9 changes: 6 additions & 3 deletions lizmap_server/get_feature_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,13 @@ def responseComplete(self):
)
continue

layer_name = result.layer.shortName()
if not layer_name:
layer_name = result.layer.name()
logger.info(
"Replacing feature {} in layer {} for the GetFeatureInfo by the drag&drop form".format(
result.feature_id, result.layer.name()))
xml = self.append_maptip(xml, result.layer.name(), result.feature_id, value)
"Replacing feature '{}' in layer '{}' for the GetFeatureInfo by the drag&drop form".format(
result.feature_id, layer_name))
xml = self.append_maptip(xml, layer_name, result.feature_id, value)

# Safeguard, it shouldn't happen
if not xml:
Expand Down
Loading

0 comments on commit ee5b205

Please sign in to comment.