3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
257 stars 143 forks source link

[Bug]: Editing fails with no feedback when trying to open a form for a invalid layer #4362

Open mdouchin opened 6 months ago

mdouchin commented 6 months ago

What is the bug? (in English)

When loading the editing form creation for a PostgreSQL layer which is invalid (wrong credentials), Lizmap fails silently and keep displaying the "progress bar" in the left panel.

The errors.log file shows the issue, for example if the PostgreSQL layer datasource credentials are wrong pg_connect(): Unable to connect to PostgreSQL server: FATAL[...]

Steps to reproduce the issue

  1. Create a working QGIS project with a PostgreSQL layer
  2. Publish this project with editing capabilities for this layer
  3. Edit the qgs file in a Text editor and replace the correct PostgreSQL user name with a non-existing PostgreSQL role
  4. Publish the new QGIS project
  5. Load the map : the Editing tool is still present, even if the layer is now invalid. When using the editing tool and create a new feature, the error happens.

Versions, safeguards, check summary etc

Last LWC master and previous versions QGIS Server versions, perhaps since the existence of the environment variable QGIS_SERVER_IGNORE_BAD_LAYERS

Check Lizmap plugin

Operating system

Any

Browsers

Firefox, Chrome, Safari, Microsoft Edge

Browsers version

Last

Relevant log output

No response

mdouchin commented 6 months ago

cc @Gustry