A n:m relation is not shown correctly in the web frontend. It just shows the pivot table
The table is defined as follows.
The following exception is thrown by the lizmap server plugin (might be related to #4307):
Mar 19 21:54:54 boromir spawn-fcgi[49512]: 21:54:54 CRITICAL Lizmap[49512]: Critical exception:
Mar 19 21:54:54 boromir spawn-fcgi[49512]: 'Relation'
Mar 19 21:54:54 boromir spawn-fcgi[49512]: Traceback (most recent call last):
Mar 19 21:54:54 boromir spawn-fcgi[49512]: File "/opt/qgis_server/plugins/lizmap_server/get_feature_info.py", line 178, in responseComplete
Mar 19 21:54:54 boromir spawn-fcgi[49512]: features = self.feature_list_to_replace(cfg, project, relation_manager, xml)
Mar 19 21:54:54 boromir spawn-fcgi[49512]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 19 21:54:54 boromir spawn-fcgi[49512]: File "/opt/qgis_server/plugins/lizmap_server/get_feature_info.py", line 121, in feature_list_to_replace
Mar 19 21:54:54 boromir spawn-fcgi[49512]: html_content = Tooltip.create_popup_node_item_from_form(layer, root, 0, [], '', relation_manager)
Mar 19 21:54:54 boromir spawn-fcgi[49512]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 19 21:54:54 boromir spawn-fcgi[49512]: File "/opt/qgis_server/plugins/lizmap_server/tooltip.py", line 180, in create_popup_node_item_from_form
Mar 19 21:54:54 boromir spawn-fcgi[49512]: h = Tooltip.create_popup_node_item_from_form(layer, n, level, headers, html, relation_manager)
Mar 19 21:54:54 boromir spawn-fcgi[49512]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 19 21:54:54 boromir spawn-fcgi[49512]: File "/opt/qgis_server/plugins/lizmap_server/tooltip.py", line 116, in create_popup_node_item_from_form
Mar 19 21:54:54 boromir spawn-fcgi[49512]: relation = relation_manager.relation(widget_config['Relation'])
Mar 19 21:54:54 boromir spawn-fcgi[49512]: ~~~~~~~~~~~~~^^^^^^^^^^^^
Mar 19 21:54:54 boromir spawn-fcgi[49512]: KeyError: 'Relation'
Therefore I changed the tooltip.py in line 114 (bad hack, I know)
if widget_type == 'RelationReference':
referenced_layer = None
if widget_config.get('Relation', None) != None:
relation = relation_manager.relation(widget_config['Relation'])
referenced_layer = relation.referencedLayer()
Now i got the following log output:
Mar 19 22:08:45 boromir spawn-fcgi[50007]: Layer trail_supervisor_dbc88c91_e3ad_464a_8d4d_9ca12f752bad does not have a valid relation reference layer for field tail_id
Mar 19 22:08:45 boromir spawn-fcgi[50007]: Layer trail_supervisor_dbc88c91_e3ad_464a_8d4d_9ca12f752bad does not have a valid relation reference layer for field supervisor_id
Not sure why the relation is missing. The layer are shared via WFS:
Steps to reproduce the issue
Also covered above...
Versions, safeguards, check summary etc
Versions :
Lizmap Web Client : 3.7.5
Lizmap plugin : 4.2.7
QGIS Desktop : 3.34.4
QGIS Server : 3.36.0
Py-QGIS-Server : not used
QGIS Server plugin atlasprint : not found
QGIS Server plugin lizmap_server : 2.8.6
QGIS Server plugin wfsOutputExtension : 1.8.0
List of safeguards :
* Mode : normal
* Allow parent folder : no
* Prevent other drive : yes
* Prevent PG service : yes
* Prevent PG Auth DB : yes
* Force PG user&pass : no
* Prevent ECW : yes
Check Lizmap plugin
[X] I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.
What is the bug? (in English)
A n:m relation is not shown correctly in the web frontend. It just shows the pivot table
The table is defined as follows.
The following exception is thrown by the lizmap server plugin (might be related to #4307):
Therefore I changed the
tooltip.py
in line 114 (bad hack, I know)Now i got the following log output:
Not sure why the relation is missing. The layer are shared via WFS:
Steps to reproduce the issue
Also covered above...
Versions, safeguards, check summary etc
Versions :
List of safeguards :
* Mode : normal * Allow parent folder : no * Prevent other drive : yes * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : no * Prevent ECW : yes
Check Lizmap plugin
Operating system
Windows 11
Browsers
Chrome
Browsers version
Vivaldi 6.5.3206.53 (Stable channel) (32-Bit)
Relevant log output
No response