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
259 stars 143 forks source link

[Bug]: Datetime fields with editing capabilities #3374

Open Gustry opened 1 year ago

Gustry commented 1 year ago

What is the bug?

I'm trying to setup a test with many different date, timestamp and time fields

Steps to reproduce the issue

DROP TABLE IF EXISTS bug.many_dates;
CREATE TABLE bug.many_dates (
    id SERIAL PRIMARY KEY,
    -- simple cases
    field_date DATE,
    field_time TIME,
    field_timestamp TIMESTAMP,
    -- Using now() with a cast
    field_date_auto_cast DATE DEFAULT now()::date,
    field_time_auto_cast TIME DEFAULT now()::time,
    field_timestamp_auto_cast TIMESTAMP DEFAULT now()::timestamp(0),
    -- Using now without cast
    field_date_auto DATE DEFAULT now(),
    field_time_auto TIME DEFAULT now(),
    field_timestamp_auto TIMESTAMP DEFAULT now(),
    -- Using now() expression in QGIS
    field_date_expr_now DATE,
    field_time_expr_now TIME,
    field_timestamp_expr_now TIMESTAMP,
    -- Using both now() in QGIS and PostgreSQL
    field_date_expr_now_auto DATE DEFAULT now(),
    field_time_expr_now_auto TIME DEFAULT now(),
    field_timestamp_expr_now_auto TIMESTAMP DEFAULT now(),
    -- A timestamp field used only with date format in QGIS
    field_timestamp_date_only TIMESTAMP,
    field_timestamp_date_only_auto TIMESTAMP DEFAULT now(),
    field_timestamp_date_only_expr_now TIMESTAMP,
    field_timestamp_date_only_expr_now_auto TIMESTAMP DEFAULT now()
);

image

All fields are "NULL" authorized, so in LWC, I should be able to load the form and click save straight.

image

But when I click

image

After fixing error using UI and removing microseconds AND/OR dates, I still have an unknown error :

image

I somehow can't add a QML or ZIP file, so I'm adding the content here :

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.22.13-Białowieża" styleCategories="Fields|Forms">
  <fieldConfiguration>
    <field name="id" configurationFlags="None">
      <editWidget type="TextEdit">
        <config>
          <Option type="Map">
            <Option name="IsMultiline" value="false" type="bool"/>
            <Option name="UseHtml" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_date" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_time" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_date_auto_cast" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_time_auto_cast" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_auto_cast" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_date_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_time_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_date_expr_now" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_time_expr_now" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_expr_now" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_date_expr_now_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_time_expr_now_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_expr_now_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_date_only" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_date_only_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_format" value="HH:mm:ss" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_date_only_expr_now" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
    <field name="field_timestamp_date_only_expr_now_auto" configurationFlags="None">
      <editWidget type="DateTime">
        <config>
          <Option type="Map">
            <Option name="allow_null" value="true" type="bool"/>
            <Option name="calendar_popup" value="true" type="bool"/>
            <Option name="display_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_format" value="dd/MM/yyyy" type="QString"/>
            <Option name="field_iso_format" value="false" type="bool"/>
          </Option>
        </config>
      </editWidget>
    </field>
  </fieldConfiguration>
  <aliases>
    <alias name="" field="id" index="0"/>
    <alias name="" field="field_date" index="1"/>
    <alias name="" field="field_time" index="2"/>
    <alias name="" field="field_timestamp" index="3"/>
    <alias name="" field="field_date_auto_cast" index="4"/>
    <alias name="" field="field_time_auto_cast" index="5"/>
    <alias name="" field="field_timestamp_auto_cast" index="6"/>
    <alias name="" field="field_date_auto" index="7"/>
    <alias name="" field="field_time_auto" index="8"/>
    <alias name="" field="field_timestamp_auto" index="9"/>
    <alias name="" field="field_date_expr_now" index="10"/>
    <alias name="" field="field_time_expr_now" index="11"/>
    <alias name="" field="field_timestamp_expr_now" index="12"/>
    <alias name="" field="field_date_expr_now_auto" index="13"/>
    <alias name="" field="field_time_expr_now_auto" index="14"/>
    <alias name="" field="field_timestamp_expr_now_auto" index="15"/>
    <alias name="" field="field_timestamp_date_only" index="16"/>
    <alias name="" field="field_timestamp_date_only_auto" index="17"/>
    <alias name="" field="field_timestamp_date_only_expr_now" index="18"/>
    <alias name="" field="field_timestamp_date_only_expr_now_auto" index="19"/>
  </aliases>
  <defaults>
    <default field="id" applyOnUpdate="0" expression=""/>
    <default field="field_date" applyOnUpdate="0" expression=""/>
    <default field="field_time" applyOnUpdate="0" expression=""/>
    <default field="field_timestamp" applyOnUpdate="0" expression=""/>
    <default field="field_date_auto_cast" applyOnUpdate="0" expression=""/>
    <default field="field_time_auto_cast" applyOnUpdate="0" expression=""/>
    <default field="field_timestamp_auto_cast" applyOnUpdate="0" expression=""/>
    <default field="field_date_auto" applyOnUpdate="0" expression=""/>
    <default field="field_time_auto" applyOnUpdate="0" expression=""/>
    <default field="field_timestamp_auto" applyOnUpdate="0" expression=""/>
    <default field="field_date_expr_now" applyOnUpdate="0" expression="now()"/>
    <default field="field_time_expr_now" applyOnUpdate="0" expression="now()"/>
    <default field="field_timestamp_expr_now" applyOnUpdate="0" expression="now()"/>
    <default field="field_date_expr_now_auto" applyOnUpdate="0" expression="now()"/>
    <default field="field_time_expr_now_auto" applyOnUpdate="0" expression="now()"/>
    <default field="field_timestamp_expr_now_auto" applyOnUpdate="0" expression="now()"/>
    <default field="field_timestamp_date_only" applyOnUpdate="0" expression=""/>
    <default field="field_timestamp_date_only_auto" applyOnUpdate="0" expression=""/>
    <default field="field_timestamp_date_only_expr_now" applyOnUpdate="0" expression="now()"/>
    <default field="field_timestamp_date_only_expr_now_auto" applyOnUpdate="0" expression="now()"/>
  </defaults>
  <constraints>
    <constraint field="id" constraints="3" notnull_strength="1" exp_strength="0" unique_strength="1"/>
    <constraint field="field_date" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_time" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_date_auto_cast" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_time_auto_cast" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_auto_cast" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_date_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_time_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_date_expr_now" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_time_expr_now" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_expr_now" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_date_expr_now_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_time_expr_now_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_expr_now_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_date_only" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_date_only_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_date_only_expr_now" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
    <constraint field="field_timestamp_date_only_expr_now_auto" constraints="0" notnull_strength="0" exp_strength="0" unique_strength="0"/>
  </constraints>
  <constraintExpressions>
    <constraint field="id" exp="" desc=""/>
    <constraint field="field_date" exp="" desc=""/>
    <constraint field="field_time" exp="" desc=""/>
    <constraint field="field_timestamp" exp="" desc=""/>
    <constraint field="field_date_auto_cast" exp="" desc=""/>
    <constraint field="field_time_auto_cast" exp="" desc=""/>
    <constraint field="field_timestamp_auto_cast" exp="" desc=""/>
    <constraint field="field_date_auto" exp="" desc=""/>
    <constraint field="field_time_auto" exp="" desc=""/>
    <constraint field="field_timestamp_auto" exp="" desc=""/>
    <constraint field="field_date_expr_now" exp="" desc=""/>
    <constraint field="field_time_expr_now" exp="" desc=""/>
    <constraint field="field_timestamp_expr_now" exp="" desc=""/>
    <constraint field="field_date_expr_now_auto" exp="" desc=""/>
    <constraint field="field_time_expr_now_auto" exp="" desc=""/>
    <constraint field="field_timestamp_expr_now_auto" exp="" desc=""/>
    <constraint field="field_timestamp_date_only" exp="" desc=""/>
    <constraint field="field_timestamp_date_only_auto" exp="" desc=""/>
    <constraint field="field_timestamp_date_only_expr_now" exp="" desc=""/>
    <constraint field="field_timestamp_date_only_expr_now_auto" exp="" desc=""/>
  </constraintExpressions>
  <expressionfields/>
  <editform tolerant="1"></editform>
  <editforminit/>
  <editforminitcodesource>0</editforminitcodesource>
  <editforminitfilepath></editforminitfilepath>
  <editforminitcode><![CDATA[# -*- coding: utf-8 -*-
"""
QGIS forms can have a Python function that is called when the form is
opened.

Use this function to add extra logic to your forms.

Enter the name of the function in the "Python Init function"
field.
An example follows:
"""
from qgis.PyQt.QtWidgets import QWidget

def my_form_open(dialog, layer, feature):
    geom = feature.geometry()
    control = dialog.findChild(QWidget, "MyLineEdit")
]]></editforminitcode>
  <featformsuppress>0</featformsuppress>
  <editorlayout>tablayout</editorlayout>
  <attributeEditorForm>
    <attributeEditorContainer name="Tests" showLabel="1" columnCount="1" groupBox="0" visibilityExpression="" visibilityExpressionEnabled="0">
      <attributeEditorContainer name="Simple" showLabel="1" columnCount="1" groupBox="1" visibilityExpression="" visibilityExpressionEnabled="0">
        <attributeEditorField name="field_date" showLabel="1" index="1"/>
        <attributeEditorField name="field_time" showLabel="1" index="2"/>
        <attributeEditorField name="field_timestamp" showLabel="1" index="3"/>
      </attributeEditorContainer>
      <attributeEditorContainer name="PG now() with cast" showLabel="1" columnCount="1" groupBox="1" visibilityExpression="" visibilityExpressionEnabled="0">
        <attributeEditorField name="field_date_auto_cast" showLabel="1" index="4"/>
        <attributeEditorField name="field_time_auto_cast" showLabel="1" index="5"/>
        <attributeEditorField name="field_timestamp_auto_cast" showLabel="1" index="6"/>
      </attributeEditorContainer>
      <attributeEditorContainer name="PG now() without cast" showLabel="1" columnCount="1" groupBox="1" visibilityExpression="" visibilityExpressionEnabled="0">
        <attributeEditorField name="field_date_auto" showLabel="1" index="7"/>
        <attributeEditorField name="field_time_auto" showLabel="1" index="8"/>
        <attributeEditorField name="field_timestamp_auto" showLabel="1" index="9"/>
      </attributeEditorContainer>
      <attributeEditorContainer name="QGIS now()" showLabel="1" columnCount="1" groupBox="1" visibilityExpression="" visibilityExpressionEnabled="0">
        <attributeEditorField name="field_date_expr_now" showLabel="1" index="10"/>
        <attributeEditorField name="field_time_expr_now" showLabel="1" index="11"/>
        <attributeEditorField name="field_timestamp_expr_now" showLabel="1" index="12"/>
      </attributeEditorContainer>
      <attributeEditorContainer name="PG now() and QGIS now()" showLabel="1" columnCount="1" groupBox="1" visibilityExpression="" visibilityExpressionEnabled="0">
        <attributeEditorField name="field_date_expr_now_auto" showLabel="1" index="13"/>
        <attributeEditorField name="field_time_expr_now_auto" showLabel="1" index="14"/>
        <attributeEditorField name="field_timestamp_expr_now_auto" showLabel="1" index="15"/>
      </attributeEditorContainer>
      <attributeEditorContainer name="Timestamp as date" showLabel="1" columnCount="1" groupBox="1" visibilityExpression="" visibilityExpressionEnabled="0">
        <attributeEditorField name="field_timestamp_date_only" showLabel="1" index="16"/>
        <attributeEditorField name="field_timestamp_date_only_auto" showLabel="1" index="17"/>
        <attributeEditorField name="field_timestamp_date_only_expr_now" showLabel="1" index="18"/>
        <attributeEditorField name="field_timestamp_date_only_expr_now_auto" showLabel="1" index="19"/>
      </attributeEditorContainer>
    </attributeEditorContainer>
  </attributeEditorForm>
  <editable>
    <field name="field_date" editable="1"/>
    <field name="field_date_auto" editable="1"/>
    <field name="field_date_auto_cast" editable="1"/>
    <field name="field_date_expr_now" editable="1"/>
    <field name="field_date_expr_now_auto" editable="1"/>
    <field name="field_time" editable="1"/>
    <field name="field_time_auto" editable="1"/>
    <field name="field_time_auto_cast" editable="1"/>
    <field name="field_time_expr_now" editable="1"/>
    <field name="field_time_expr_now_auto" editable="1"/>
    <field name="field_timestamp" editable="1"/>
    <field name="field_timestamp_auto" editable="1"/>
    <field name="field_timestamp_auto_cast" editable="1"/>
    <field name="field_timestamp_date_only" editable="1"/>
    <field name="field_timestamp_date_only_auto" editable="1"/>
    <field name="field_timestamp_date_only_expr_now" editable="1"/>
    <field name="field_timestamp_date_only_expr_now_auto" editable="1"/>
    <field name="field_timestamp_expr_now" editable="1"/>
    <field name="field_timestamp_expr_now_auto" editable="1"/>
    <field name="id" editable="1"/>
  </editable>
  <labelOnTop>
    <field name="field_date" labelOnTop="0"/>
    <field name="field_date_auto" labelOnTop="0"/>
    <field name="field_date_auto_cast" labelOnTop="0"/>
    <field name="field_date_expr_now" labelOnTop="0"/>
    <field name="field_date_expr_now_auto" labelOnTop="0"/>
    <field name="field_time" labelOnTop="0"/>
    <field name="field_time_auto" labelOnTop="0"/>
    <field name="field_time_auto_cast" labelOnTop="0"/>
    <field name="field_time_expr_now" labelOnTop="0"/>
    <field name="field_time_expr_now_auto" labelOnTop="0"/>
    <field name="field_timestamp" labelOnTop="0"/>
    <field name="field_timestamp_auto" labelOnTop="0"/>
    <field name="field_timestamp_auto_cast" labelOnTop="0"/>
    <field name="field_timestamp_date_only" labelOnTop="0"/>
    <field name="field_timestamp_date_only_auto" labelOnTop="0"/>
    <field name="field_timestamp_date_only_expr_now" labelOnTop="0"/>
    <field name="field_timestamp_date_only_expr_now_auto" labelOnTop="0"/>
    <field name="field_timestamp_expr_now" labelOnTop="0"/>
    <field name="field_timestamp_expr_now_auto" labelOnTop="0"/>
    <field name="id" labelOnTop="0"/>
  </labelOnTop>
  <reuseLastValue>
    <field name="field_date" reuseLastValue="0"/>
    <field name="field_date_auto" reuseLastValue="0"/>
    <field name="field_date_auto_cast" reuseLastValue="0"/>
    <field name="field_date_expr_now" reuseLastValue="0"/>
    <field name="field_date_expr_now_auto" reuseLastValue="0"/>
    <field name="field_time" reuseLastValue="0"/>
    <field name="field_time_auto" reuseLastValue="0"/>
    <field name="field_time_auto_cast" reuseLastValue="0"/>
    <field name="field_time_expr_now" reuseLastValue="0"/>
    <field name="field_time_expr_now_auto" reuseLastValue="0"/>
    <field name="field_timestamp" reuseLastValue="0"/>
    <field name="field_timestamp_auto" reuseLastValue="0"/>
    <field name="field_timestamp_auto_cast" reuseLastValue="0"/>
    <field name="field_timestamp_date_only" reuseLastValue="0"/>
    <field name="field_timestamp_date_only_auto" reuseLastValue="0"/>
    <field name="field_timestamp_date_only_expr_now" reuseLastValue="0"/>
    <field name="field_timestamp_date_only_expr_now_auto" reuseLastValue="0"/>
    <field name="field_timestamp_expr_now" reuseLastValue="0"/>
    <field name="field_timestamp_expr_now_auto" reuseLastValue="0"/>
    <field name="id" reuseLastValue="0"/>
  </reuseLastValue>
  <dataDefinedFieldProperties/>
  <widgets/>
  <layerGeometryType>4</layerGeometryType>
</qgis>

Versions

QGIS 3.22 with LWC 3.6.0 and master

Check Lizmap plugin

QGIS server version, only if the section above doesn't mention the QGIS Server version

3.22.8

Operating system

Ubuntu

Browsers

Firefox

Browsers version

108

Relevant log output

2022-12-16 17:19:16 172.19.0.1  error   An error has been raised when saving form data edition to db : 
2022-12-16 17:19:16 172.19.0.1  error   2022-12-16 17:19:16 172.19.0.1  [403]   invalid query (ERROR:  date/time field value out of range: "16/12/2022"
LINE 1: ..._auto", "field_timestamp_expr_now_auto" ) VALUES ('16/12/202...
                                                             ^
HINT:  Perhaps you need a different "datestyle" setting.( INSERT INTO "bug"."many_dates" ("field_date_auto", "field_time_auto", "field_timestamp_auto", "field_date_expr_now", "field_time_expr_now", "field_timestamp_expr_now", "field_date_expr_now_auto", "field_time_expr_now_auto", "field_timestamp_expr_now_auto" ) VALUES ('16/12/2022', '16:18:03', '16/12/2022 16:18:03', '16/12/2022', '16:18:03', '16/12/2022 16:18:03', '16/12/2022', '16:18:03', '16/12/2022 16:18:03' )  RETURNING "id";))  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php    211
    /index.php/lizmap/edition/saveFeature
array (   'module' => 'lizmap',   'action' => 'edition:saveFeature',   'liz_project' => 'dates',   'liz_repository' => 'formation',   'liz_layerId' => 'many_dates_080b18e4_488f_4614_991d_44625b7b7a0e',   'liz_featureId' => '',   'liz_srid' => '0',   'liz_proj4' => '',   'liz_geometryColumn' => '',   'liz_status' => '0',   '_submit' => 'submit',   '__JFORMS_TOKEN__' => 'af19657d8251fdfa6ad8660d28bb3819128f0cef',   'field_date' =>    array (     'month' => '',     'day' => '',     'year' => '',   ),   'field_time' => '',   'field_timestamp' =>    array (     'month' => '',     'day' => '',     'year' => '',     'hour' => '',     'minutes' => '',     'seconds' => '',   ),   'field_date_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_auto' => '16:18:03',   'field_timestamp_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '18',     'seconds' => '03',   ),   'field_date_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_expr_now' => '16:18:03',   'field_timestamp_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '18',     'seconds' => '03',   ),   'field_date_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_expr_now_auto' => '16:18:03',   'field_timestamp_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '18',     'seconds' => '03',   ),   'liz_future_action' => 'close', )

    0   pgsqlDbConnection->_doQuery()   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/db/jDbConnection.class.php : 159
    1   jDbConnection->query()  /srv/lzm/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php : 771
    2   qgisVectorLayer->insertFeature()    /srv/lzm/lizmap/modules/lizmap/lib/Form/QgisForm.php : 831
    3   Lizmap\Form\QgisForm->saveToDb()    /srv/lzm/lizmap/modules/lizmap/controllers/edition.classic.php : 691
    4   editionCtrl->saveFeature()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266
    5   jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23
2022-12-16 17:53:36 172.19.0.1  warning [2] pg_query(): Query failed: ERROR:  date/time field value out of range: &quot;16/12/2022&quot;
LINE 1: ...ield_timestamp_date_only_expr_now_auto&quot; ) VALUES ('16/12/202...
                                                             ^
HINT:  Perhaps you need a different &quot;datestyle&quot; setting.
  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php  207
 /index.php/lizmap/edition/saveFeature
 array (   'module' => 'lizmap',   'action' => 'edition:saveFeature',   'liz_project' => 'dates',   'liz_repository' => 'formation',   'liz_layerId' => 'many_dates_080b18e4_488f_4614_991d_44625b7b7a0e',   'liz_featureId' => '',   'liz_srid' => '0',   'liz_proj4' => '',   'liz_geometryColumn' => '',   'liz_status' => '0',   '_submit' => 'submit',   '__JFORMS_TOKEN__' => '25afae6475ec1d6bb104894eebf16516ceaec8a8',   'field_date' =>    array (     'month' => '',     'day' => '',     'year' => '',   ),   'field_time' => '',   'field_timestamp' =>    array (     'month' => '',     'day' => '',     'year' => '',     'hour' => '',     'minutes' => '',     'seconds' => '',   ),   'field_date_auto_cast' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_auto_cast' => '16:52:02',   'field_timestamp_auto_cast' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '02',   ),   'field_date_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_auto' => '16:52:02',   'field_timestamp_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '02',   ),   'field_date_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_expr_now' => '16:52:01',   'field_timestamp_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '01',   ),   'field_date_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_expr_now_auto' => '16:52:02',   'field_timestamp_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '02',   ),   'field_timestamp_date_only' =>    array (     'month' => '',     'day' => '',     'year' => '',   ),   'field_timestamp_date_only_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'liz_future_action' => 'close', )
 ref:http://localhost:8130/index.php/view/map?repository=formation&project=dates

    0   pg_query()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php : 207
    1   pgsqlDbConnection->_doQuery()   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/db/jDbConnection.class.php : 159
    2   jDbConnection->query()  /srv/lzm/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php : 771
    3   qgisVectorLayer->insertFeature()    /srv/lzm/lizmap/modules/lizmap/lib/Form/QgisForm.php : 831
    4   Lizmap\Form\QgisForm->saveToDb()    /srv/lzm/lizmap/modules/lizmap/controllers/edition.classic.php : 691
    5   editionCtrl->saveFeature()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266
    6   jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23

2022-12-16 17:53:36 172.19.0.1  error   An error has been raised when saving form data edition to db : 
2022-12-16 17:53:36 172.19.0.1  error   2022-12-16 17:53:36 172.19.0.1  [403]   invalid query (ERROR:  date/time field value out of range: "16/12/2022"
LINE 1: ...ield_timestamp_date_only_expr_now_auto" ) VALUES ('16/12/202...
                                                             ^
HINT:  Perhaps you need a different "datestyle" setting.( INSERT INTO "bug"."many_dates" ("field_date_auto_cast", "field_time_auto_cast", "field_timestamp_auto_cast", "field_date_auto", "field_time_auto", "field_timestamp_auto", "field_date_expr_now", "field_time_expr_now", "field_timestamp_expr_now", "field_date_expr_now_auto", "field_time_expr_now_auto", "field_timestamp_expr_now_auto", "field_timestamp_date_only_auto", "field_timestamp_date_only_expr_now", "field_timestamp_date_only_expr_now_auto" ) VALUES ('16/12/2022', '16:52:02', '16/12/2022 16:52:02', '16/12/2022', '16:52:02', '16/12/2022 16:52:02', '16/12/2022', '16:52:01', '16/12/2022 16:52:01', '16/12/2022', '16:52:02', '16/12/2022 16:52:02', '16/12/2022', '16/12/2022', '16/12/2022' )  RETURNING "id";))   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php    211
    /index.php/lizmap/edition/saveFeature
array (   'module' => 'lizmap',   'action' => 'edition:saveFeature',   'liz_project' => 'dates',   'liz_repository' => 'formation',   'liz_layerId' => 'many_dates_080b18e4_488f_4614_991d_44625b7b7a0e',   'liz_featureId' => '',   'liz_srid' => '0',   'liz_proj4' => '',   'liz_geometryColumn' => '',   'liz_status' => '0',   '_submit' => 'submit',   '__JFORMS_TOKEN__' => '25afae6475ec1d6bb104894eebf16516ceaec8a8',   'field_date' =>    array (     'month' => '',     'day' => '',     'year' => '',   ),   'field_time' => '',   'field_timestamp' =>    array (     'month' => '',     'day' => '',     'year' => '',     'hour' => '',     'minutes' => '',     'seconds' => '',   ),   'field_date_auto_cast' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_auto_cast' => '16:52:02',   'field_timestamp_auto_cast' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '02',   ),   'field_date_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_auto' => '16:52:02',   'field_timestamp_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '02',   ),   'field_date_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_expr_now' => '16:52:01',   'field_timestamp_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '01',   ),   'field_date_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_time_expr_now_auto' => '16:52:02',   'field_timestamp_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',     'hour' => '16',     'minutes' => '52',     'seconds' => '02',   ),   'field_timestamp_date_only' =>    array (     'month' => '',     'day' => '',     'year' => '',   ),   'field_timestamp_date_only_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now_auto' =>    array (     'month' => '12',     'day' => '16',     'year' => '2022',   ),   'liz_future_action' => 'close', )

    0   pgsqlDbConnection->_doQuery()   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/db/jDbConnection.class.php : 159
    1   jDbConnection->query()  /srv/lzm/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php : 771
    2   qgisVectorLayer->insertFeature()    /srv/lzm/lizmap/modules/lizmap/lib/Form/QgisForm.php : 831
    3   Lizmap\Form\QgisForm->saveToDb()    /srv/lzm/lizmap/modules/lizmap/controllers/edition.classic.php : 691
    4   editionCtrl->saveFeature()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266
    5   jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23
Gustry commented 1 year ago

According to the UI, it seems "time only" field are not supported. So I removed them from the Drag&Drop form. It's the same result :

5   editionCtrl->saveFeature()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266
    6   jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23

2022-12-19 10:14:12 172.19.0.1  error   An error has been raised when saving form data edition to db : 
2022-12-19 10:14:12 172.19.0.1  error   2022-12-19 10:14:12 172.19.0.1  [403]   invalid query (ERROR:  date/time field value out of range: "19/12/2022"
LINE 1: ...ield_timestamp_date_only_expr_now_auto" ) VALUES ('19/12/202...
                                                             ^
HINT:  Perhaps you need a different "datestyle" setting.( INSERT INTO "bug"."many_dates" ("field_date_auto_cast", "field_time_auto_cast", "field_timestamp_auto_cast", "field_date_auto", "field_time_auto", "field_timestamp_auto", "field_date_expr_now", "field_time_expr_now", "field_timestamp_expr_now", "field_date_expr_now_auto", "field_time_expr_now_auto", "field_timestamp_expr_now_auto", "field_timestamp_date_only_auto", "field_timestamp_date_only_expr_now", "field_timestamp_date_only_expr_now_auto" ) VALUES ('19/12/2022', '9:14:03', '19/12/2022 9:14:04', '19/12/2022', '9:14:03', '19/12/2022 9:14:03', '19/12/2022', '9:14:03', '19/12/2022 9:14:03', '19/12/2022', '9:14:03', '19/12/2022 9:14:03', '19/12/2022', '19/12/2022', '19/12/2022' )  RETURNING "id";))   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php    211
    /index.php/lizmap/edition/saveFeature
array (   'module' => 'lizmap',   'action' => 'edition:saveFeature',   'liz_project' => 'dates',   'liz_repository' => 'formation',   'liz_layerId' => 'many_dates_080b18e4_488f_4614_991d_44625b7b7a0e',   'liz_featureId' => '',   'liz_srid' => '0',   'liz_proj4' => '',   'liz_geometryColumn' => '',   'liz_status' => '0',   '_submit' => 'submit',   '__JFORMS_TOKEN__' => '94dbc5213a63c64e67614a558e81f11db4ebef1b',   'field_date' =>    array (     'month' => '',     'day' => '',     'year' => '',   ),   'field_timestamp' =>    array (     'month' => '',     'day' => '',     'year' => '',     'hour' => '',     'minutes' => '',     'seconds' => '',   ),   'field_date_auto_cast' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_auto_cast' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '04',   ),   'field_date_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_date_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_date_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_timestamp_date_only' =>    array (     'month' => '',     'day' => '',     'year' => '',   ),   'field_timestamp_date_only_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'liz_future_action' => 'close', )

    0   pgsqlDbConnection->_doQuery()   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/db/jDbConnection.class.php : 159
    1   jDbConnection->query()  /srv/lzm/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php : 771
    2   qgisVectorLayer->insertFeature()    /srv/lzm/lizmap/modules/lizmap/lib/Form/QgisForm.php : 831
    3   Lizmap\Form\QgisForm->saveToDb()    /srv/lzm/lizmap/modules/lizmap/controllers/edition.classic.php : 691
    4   editionCtrl->saveFeature()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266
    5   jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23
2022-12-19 10:15:15 172.19.0.1  warning [2] pg_query(): Query failed: ERROR:  date/time field value out of range: &quot;19/12/2022&quot;
LINE 1: ...o&quot; ) VALUES ('04/12/2022', '04/12/2022 12:00:00', '19/12/202...
                                                             ^
HINT:  Perhaps you need a different &quot;datestyle&quot; setting.
  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php  207
 /index.php/lizmap/edition/saveFeature
 array (   'module' => 'lizmap',   'action' => 'edition:saveFeature',   'liz_project' => 'dates',   'liz_repository' => 'formation',   'liz_layerId' => 'many_dates_080b18e4_488f_4614_991d_44625b7b7a0e',   'liz_featureId' => '',   'liz_srid' => '0',   'liz_proj4' => '',   'liz_geometryColumn' => '',   'liz_status' => '1',   '_submit' => 'submit',   '__JFORMS_TOKEN__' => '94dbc5213a63c64e67614a558e81f11db4ebef1b',   'field_date' =>    array (     'month' => '12',     'day' => '04',     'year' => '2022',   ),   'field_timestamp' =>    array (     'month' => '12',     'day' => '04',     'year' => '2022',     'hour' => '12',     'minutes' => '00',     'seconds' => '',   ),   'field_date_auto_cast' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_auto_cast' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '04',   ),   'field_date_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_date_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_date_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_timestamp_date_only' =>    array (     'month' => '12',     'day' => '11',     'year' => '2022',   ),   'field_timestamp_date_only_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'liz_future_action' => 'close', )
 ref:http://localhost:8130/index.php/view/map?repository=formation&project=dates

    0   pg_query()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php : 207
    1   pgsqlDbConnection->_doQuery()   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/db/jDbConnection.class.php : 159
    2   jDbConnection->query()  /srv/lzm/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php : 771
    3   qgisVectorLayer->insertFeature()    /srv/lzm/lizmap/modules/lizmap/lib/Form/QgisForm.php : 831
    4   Lizmap\Form\QgisForm->saveToDb()    /srv/lzm/lizmap/modules/lizmap/controllers/edition.classic.php : 691
    5   editionCtrl->saveFeature()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266
    6   jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23

2022-12-19 10:15:15 172.19.0.1  error   An error has been raised when saving form data edition to db : 
2022-12-19 10:15:15 172.19.0.1  error   2022-12-19 10:15:15 172.19.0.1  [403]   invalid query (ERROR:  date/time field value out of range: "19/12/2022"
LINE 1: ...o" ) VALUES ('04/12/2022', '04/12/2022 12:00:00', '19/12/202...
                                                             ^
HINT:  Perhaps you need a different "datestyle" setting.( INSERT INTO "bug"."many_dates" ("field_date", "field_timestamp", "field_date_auto_cast", "field_time_auto_cast", "field_timestamp_auto_cast", "field_date_auto", "field_time_auto", "field_timestamp_auto", "field_date_expr_now", "field_time_expr_now", "field_timestamp_expr_now", "field_date_expr_now_auto", "field_time_expr_now_auto", "field_timestamp_expr_now_auto", "field_timestamp_date_only", "field_timestamp_date_only_auto", "field_timestamp_date_only_expr_now", "field_timestamp_date_only_expr_now_auto" ) VALUES ('04/12/2022', '04/12/2022 12:00:00', '19/12/2022', '9:14:03', '19/12/2022 9:14:04', '19/12/2022', '9:14:03', '19/12/2022 9:14:03', '19/12/2022', '9:14:03', '19/12/2022 9:14:03', '19/12/2022', '9:14:03', '19/12/2022 9:14:03', '11/12/2022', '19/12/2022', '19/12/2022', '19/12/2022' )  RETURNING "id";))  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php    211
    /index.php/lizmap/edition/saveFeature
array (   'module' => 'lizmap',   'action' => 'edition:saveFeature',   'liz_project' => 'dates',   'liz_repository' => 'formation',   'liz_layerId' => 'many_dates_080b18e4_488f_4614_991d_44625b7b7a0e',   'liz_featureId' => '',   'liz_srid' => '0',   'liz_proj4' => '',   'liz_geometryColumn' => '',   'liz_status' => '1',   '_submit' => 'submit',   '__JFORMS_TOKEN__' => '94dbc5213a63c64e67614a558e81f11db4ebef1b',   'field_date' =>    array (     'month' => '12',     'day' => '04',     'year' => '2022',   ),   'field_timestamp' =>    array (     'month' => '12',     'day' => '04',     'year' => '2022',     'hour' => '12',     'minutes' => '00',     'seconds' => '',   ),   'field_date_auto_cast' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_auto_cast' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '04',   ),   'field_date_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_date_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_date_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',     'hour' => '09',     'minutes' => '14',     'seconds' => '03',   ),   'field_timestamp_date_only' =>    array (     'month' => '12',     'day' => '11',     'year' => '2022',   ),   'field_timestamp_date_only_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'field_timestamp_date_only_expr_now_auto' =>    array (     'month' => '12',     'day' => '19',     'year' => '2022',   ),   'liz_future_action' => 'close', )

    0   pgsqlDbConnection->_doQuery()   /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/db/jDbConnection.class.php : 159
    1   jDbConnection->query()  /srv/lzm/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php : 771
    2   qgisVectorLayer->insertFeature()    /srv/lzm/lizmap/modules/lizmap/lib/Form/QgisForm.php : 831
    3   Lizmap\Form\QgisForm->saveToDb()    /srv/lzm/lizmap/modules/lizmap/controllers/edition.classic.php : 691
    4   editionCtrl->saveFeature()  /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266
    5   jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23

image

Gustry commented 1 year ago

I noticed the one hour difference from my computer versus the server (QGIS/PG)

Gustry commented 1 year ago

Tests data have been committed in the repository : 887b75f42, related to another ticket about the display #828

Gustry commented 1 year ago

Backport of the test data into 3.6 in aa690d3ec98cfe9a62cf89665a0f3d05fafc8215