Closed nboisteault closed 2 years ago
@mdouchin @Gustry I can get back correct behavior by commenting https://github.com/3liz/lizmap-web-client/blob/master/lizmap/modules/lizmap/lib/Project/QgisProject.php#L1000
So the bug fix might be to write custom_config
whenever a user creates a custom config or not. This should be renamed column_order
.
You can't comment this line, because you are maybe reading all CFG without this key.
And this key custom_config
is written whatever the value True
or False
as we can see in tests : https://github.com/3liz/lizmap-web-client/search?q=custom_config
{
"locateByLayer": {},
"formFilterLayers": {
"0": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"title": "label from int (value relation)",
"type": "uniquevalues",
"field": "label_from_int_value_relation",
"format": "checkboxes",
"order": 0,
"provider": "postgres"
},
"1": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"title": "label from text (value relation)",
"type": "uniquevalues",
"field": "label_from_text_value_relation",
"format": "checkboxes",
"order": 1,
"provider": "postgres"
},
"2": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"title": "label from int (value map)",
"type": "uniquevalues",
"field": "label_from_int_value_map",
"format": "checkboxes",
"order": 2,
"provider": "postgres"
},
"3": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"title": "label from text (value map)",
"type": "uniquevalues",
"field": "label_from_text_value_map",
"format": "checkboxes",
"order": 3,
"provider": "postgres"
},
"4": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"title": "label from int (relation reference)",
"type": "uniquevalues",
"field": "label_from_int_relation_reference",
"format": "checkboxes",
"order": 4,
"provider": "postgres"
},
"5": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"title": "label from text (relation reference)",
"type": "uniquevalues",
"field": "label_from_text_relation_reference",
"format": "checkboxes",
"order": 5,
"provider": "postgres"
}
},
"editionLayers": {
"attribute_table": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"snap_vertices": "False",
"snap_segments": "False",
"snap_intersections": "False",
"snap_vertices_tolerance": 10,
"snap_segments_tolerance": 10,
"snap_intersections_tolerance": 10,
"provider": "postgres",
"capabilities": {
"createFeature": "True",
"allow_without_geom": "False",
"modifyAttribute": "True",
"modifyGeometry": "False",
"deleteFeature": "True"
},
"geometryType": "none",
"order": 0
},
"data_integers": {
"layerId": "data_integers_ae40b1b1_9f4f_411b_8815_6b29fa580f00",
"snap_vertices": "False",
"snap_segments": "False",
"snap_intersections": "False",
"snap_vertices_tolerance": 10,
"snap_segments_tolerance": 10,
"snap_intersections_tolerance": 10,
"provider": "postgres",
"capabilities": {
"createFeature": "False",
"allow_without_geom": "False",
"modifyAttribute": "True",
"modifyGeometry": "False",
"deleteFeature": "False"
},
"geometryType": "none",
"order": 1
}
},
"attributeLayers": {
"attribute_table": {
"layerId": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"primaryKey": "id",
"pivot": "False",
"hideAsChild": "False",
"hideLayer": "False",
"custom_config": "True",
"order": 0,
"attributetableconfig": {
"attributes": {
"actionWidgetStyle": "dropDown",
"sortExpression": "\"id\"",
"sortOrder": "0"
},
"columns": {
"column": [
{
"attributes": {
"hidden": "0",
"name": "id",
"type": "field",
"width": "-1"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_int_value_relation",
"type": "field",
"width": "-1"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_text_value_relation",
"type": "field",
"width": "314"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_int_value_map",
"type": "field",
"width": "270"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_text_value_map",
"type": "field",
"width": "362"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_int_relation_reference",
"type": "field",
"width": "288"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_text_relation_reference",
"type": "field",
"width": "50"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_array_text_multiple_value_relation",
"type": "field",
"width": "100"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_text_multiple_value_relation",
"type": "field",
"width": "246"
}
},
{
"attributes": {
"hidden": "0",
"name": "label_from_array_int_multiple_value_relation",
"type": "field",
"width": "-1"
}
},
{
"attributes": {
"hidden": "1",
"type": "actions",
"width": "-1"
}
}
]
}
}
},
"data_integers": {
"layerId": "data_integers_ae40b1b1_9f4f_411b_8815_6b29fa580f00",
"primaryKey": "id",
"pivot": "False",
"hideAsChild": "False",
"hideLayer": "False",
"custom_config": "False",
"order": 1
},
"data_trad_en_fr": {
"layerId": "data_trad_en_fr_e48ee27d_494b_42b6_a916_8281f6045169",
"primaryKey": "id",
"pivot": "False",
"hideAsChild": "False",
"hideLayer": "False",
"custom_config": "False",
"order": 2
}
},
"layers": {
"attribute_table": {
"id": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"name": "attribute_table",
"type": "layer",
"geometryType": "none",
"extent": [
1.7976931348623157e+308,
1.7976931348623157e+308,
-1.7976931348623157e+308,
-1.7976931348623157e+308
],
"crs": "",
"title": "attribute_table",
"abstract": "",
"link": "",
"minScale": 1,
"maxScale": 1000000000000,
"toggled": "False",
"popup": "True",
"popupFrame": null,
"popupSource": "auto",
"popupTemplate": "",
"popupMaxFeatures": 10,
"popupDisplayChildren": "False",
"noLegendImage": "False",
"groupAsLayer": "False",
"baseLayer": "False",
"displayInLegend": "False",
"singleTile": "True",
"imageFormat": "image/png",
"cached": "False",
"serverFrame": null,
"clientCacheExpiration": 0
},
"data_integers": {
"id": "data_integers_ae40b1b1_9f4f_411b_8815_6b29fa580f00",
"name": "data_integers",
"type": "layer",
"geometryType": "none",
"extent": [
1.7976931348623157e+308,
1.7976931348623157e+308,
-1.7976931348623157e+308,
-1.7976931348623157e+308
],
"crs": "",
"title": "data_integers",
"abstract": "",
"link": "",
"minScale": 1,
"maxScale": 1000000000000,
"toggled": "False",
"popup": "False",
"popupFrame": null,
"popupSource": "auto",
"popupTemplate": "",
"popupMaxFeatures": 10,
"popupDisplayChildren": "False",
"noLegendImage": "False",
"groupAsLayer": "False",
"baseLayer": "False",
"displayInLegend": "False",
"singleTile": "True",
"imageFormat": "image/png",
"cached": "False",
"serverFrame": null,
"clientCacheExpiration": 0
},
"data_trad_en_fr": {
"id": "data_trad_en_fr_e48ee27d_494b_42b6_a916_8281f6045169",
"name": "data_trad_en_fr",
"type": "layer",
"geometryType": "none",
"extent": [
1.7976931348623157e+308,
1.7976931348623157e+308,
-1.7976931348623157e+308,
-1.7976931348623157e+308
],
"crs": "",
"title": "data_trad_en_fr",
"abstract": "",
"link": "",
"minScale": 1,
"maxScale": 1000000000000,
"toggled": "False",
"popup": "False",
"popupFrame": null,
"popupSource": "auto",
"popupTemplate": "",
"popupMaxFeatures": 10,
"popupDisplayChildren": "False",
"noLegendImage": "False",
"groupAsLayer": "False",
"baseLayer": "False",
"displayInLegend": "False",
"singleTile": "True",
"imageFormat": "image/png",
"cached": "False",
"serverFrame": null,
"clientCacheExpiration": 300
}
},
"timemanagerLayers": {},
"atlas": {
"layers": []
},
"tooltipLayers": {},
"loginFilteredLayers": {},
"filter_by_polygon": {
"config": {},
"layers": []
},
"datavizLayers": {
"layers": [
{
"plot_id": 0,
"layer_id": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"title": "attribute_table",
"plot": {
"type": "histogram",
"x_field": "label_from_int_value_relation",
"aggregation": "no",
"display_when_layer_visible": "False",
"traces": [
{
"color": "#086fa1",
"colorfield": "",
"y_field": "label_from_text_value_relation",
"z_field": ""
}
],
"display_legend": true,
"stacked": false,
"horizontal": false
},
"popup_display_child_plot": "False",
"only_show_child": "False",
"abstract": ""
}
],
"dataviz": {
"location": "dock",
"theme": "light"
},
"locale": "en_US"
},
"options": {
"projection": {
"proj4": "+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
"ref": "EPSG:2154"
},
"bbox": [
"766192.67223210853990167",
"6276327.0836011404171586",
"775653.03490023140329868",
"6282008.15267004910856485"
],
"mapScales": [
10000,
25000,
50000,
100000,
250000,
500000
],
"minScale": 10000,
"maxScale": 500000,
"initialExtent": [
695509.7105489259,
6321556.830522115,
695509.8816347669,
6321556.933261356
],
"popupLocation": "dock",
"pointTolerance": 25,
"lineTolerance": 10,
"polygonTolerance": 5,
"tmTimeFrameSize": 10,
"tmTimeFrameType": "seconds",
"tmAnimationFrameLength": 1000,
"datavizLocation": "dock",
"theme": "light",
"removeCache": "True",
"exportLayers": "True",
"wmsMaxWidth": "3000",
"wmsMaxHeight": "3000",
"qgisServerVersion": "3.0",
"searches": []
},
"printTemplates": [],
"relations": {
"data_integers_ae40b1b1_9f4f_411b_8815_6b29fa580f00": [
{
"referencingLayer": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"referencedField": "id",
"referencingField": "label_from_int_relation_reference",
"previewField": "label"
}
],
"data_trad_en_fr_e48ee27d_494b_42b6_a916_8281f6045169": [
{
"referencingLayer": "attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68",
"referencedField": "label_en",
"referencingField": "label_from_text_relation_reference",
"previewField": "label_fr"
}
],
"pivot": {
"attribute_table_5a99a714_c29f_40d3_9b85_89deed970e68": {
"data_integers_ae40b1b1_9f4f_411b_8815_6b29fa580f00": "label_from_int_relation_reference",
"data_trad_en_fr_e48ee27d_494b_42b6_a916_8281f6045169": "label_from_text_relation_reference"
}
}
},
"qgisServerPlugins": {
"Lizmap": {
"version": "3.7.5-beta"
},
"atlasprint": {
"version": "__error__"
}
}
}
Workaround : set "custom_config": "True"
in Lizmap cfg.
what is the purpose of this new parameter?... thanks
It's not new. It's the checkbox you can see in the Lizmap QGIS plugin, but you can't edit it. It's to explicitly warn LWC that the layer has a "attribute table custom configuration" : (field order, field display etc)
thanks @Gustry
What is the bug?
Default attribute table column order is not respected. The order is always alphabetical. This seems related to a change in QGIS Desktop/Server https://github.com/qgis/QGIS/issues/41290 . It is not mandatory for GeoJSON to have
properties
in the same order as defined in QGIS so we need another source of truth concerning order.A workaround is in QGIS to right click the columns in attribute table and
Organize columns
.Steps to reproduce the issue
wrong_wfs_geojson_attributes_order.zip
Versions
Versions :
QGIS server version, only if the section above doesn't mention the QGIS Server version
3.22.3
Operating system
Ubuntu 18.04
Browsers
Chrome
Browsers version
97
Relevant log output
No response