Open Mavialle opened 1 week ago
but when I edit it in Lizmap, it doesn't work
@Mavialle does it works in qgis?
And please upgrade your Lizmap Web Client version, the loading bar has been improved recently related to errors while loading the form.
And do the same for the Lizmap plugin, your version is old.
@gioman yes, with the same project, editing works in QGIS but not in Lizmap.
@Gustry, I upgraded the Lizmap plugin but I get a python error message when I click the OK button. Should I make another ticket ? I will upgrade the Lizmap web client as soon as possible, we have many maps with many js in use on the server, so we can't do it quickly (we need to test first if everything is OK)
Yes, open a ticket on https://github.com/3liz/lizmap-plugin/ thanks
Okay, I did it.
I'll try editing the table with a generated column when I can use the upgraded plugin again.
I'll keep you informed. Thanks !
I have successfully updated the QGIS Lizmap extension. So I deleted the cfg file and recreated it with version 4.3.18, but it still doesn't work.
I will try to update Lizmap Web Client as soon as possible, but it may take a few months.
I have nothing in the Lizmap or QGIS server logs, but in the PostgreSQL logs I have the message:
ERROR: column "geom" does not exist at character 18 STATEMENT: SELECT st_length(geom) AS v;
SELECT st_length(geom)
is the expression used in my generated column. I checked the "Evaluate vendor-side defaults" option in the Project Properties > Data Sources dialog, but nothing changed. So PostgreSQL and Lizmap Web Client don't communicate well?
If anyone wants to test it faster than me with an up to date version of Lizmapwebclient, here is the SQL code to create the very simple table I used named test in a schema named suivis
CREATE TABLE IF NOT EXISTS suivis.test
(
gid serial NOT NULL,
longueur integer GENERATED ALWAYS AS (st_length(geom)) STORED,
geom geometry(LineString,2154) NOT NULL,
commentaire character(100),
CONSTRAINT test_gid_pkey PRIMARY KEY (gid)
)
I will come back to you as soon as I have anything new
I agree it would be nice to have generated column supported. But in the meantime, you can use a trigger for this use case. Execute the trigger when the geom is updated or created.
Yes, and I do. But it's so much simpler to use the generated column : a row to create the generated column replaces a function trigger + a trigger (sometimes several). I find this to be a great innovation since PostgreSQL 12, and it's a shame that it is not compatible with using the table in Lizmap.
Feel free to contact us to improve this in Lizmap Web Client 👍
At 3Liz? I just need to explain the context and ask for a quote ?
Yes, generated columns have never been implemented, it's a new feature request, which needs some dev.
OK, I will do it as soon as possible. In the meantime, do I leave the ticket open?
What is the bug? (in English)
Generated column is a new feature of PostgreSQL 12 : https://www.postgresql.org/docs/current/ddl-generated-columns.html
I created a layer with generated columns, but when I edit it in Lizmap, it doesn't work : the edit panel loads infinitely and never opens. When I replace generated columns by normal columns, everything works normally again
Steps to reproduce the issue
Versions, safeguards, check summary etc
Versions :
List of safeguards :
* Mode : safe * Allow parent folder : no * Prevent other drive : yes * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : yes * Prevent ECW : yes
Check Lizmap plugin
Operating system
Windows 8
Browsers
Chrome
Browsers version
Version 125.0.6422.142
Relevant log output
No response