From 0078b701ffc66f06319d2028e6970e1435d12d44 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Tue, 30 Jul 2024 18:11:26 +0200 Subject: [PATCH] Add log if the relation was not found when generating the tooltip https://github.com/3liz/qgis-lizmap-server-plugin/issues/82 --- lizmap/tooltip.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lizmap/tooltip.py b/lizmap/tooltip.py index 4633fb0a..a5665992 100755 --- a/lizmap/tooltip.py +++ b/lizmap/tooltip.py @@ -141,7 +141,13 @@ def create_popup_node_item_from_form( if isinstance(node, QgsAttributeEditorRelation): relation = node.relation() - a += Tooltip._generate_attribute_editor_relation(node.label(), relation.id(), relation.referencingLayerId()) + if relation: + a += Tooltip._generate_attribute_editor_relation(node.label(), relation.id(), relation.referencingLayerId()) + else: + # Ticket https://github.com/3liz/qgis-lizmap-server-plugin/issues/82 + LOGGER.warning( + f"The node '{node.name()}::{node.label()}' cannot be processed for the tooltip " + f"because the relation has not been found.") if isinstance(node, QgsAttributeEditorContainer):