Bug report #20961
QGIS Server 3.4 can't reset numeric field using WFS Update
|Affected QGIS version:||3.5(master)||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||28780|
When doing WFS update transaction on any numeric field QGIS Server rejects null value. That would make sense only if the field cannot have null value, but this happens always for numeric fields. In this example is PostGIS table and field is integer and can contain null values.
To reproduce this is really simple just try to reset any numeric field to NULL value using WFS Update transaction and it will be rejected.
It's a regression because it's working normally on 2.18.
It's the same using WFS 1.1.0 and 1.0.0
Transaction is correctly formed and QGIS Server result is below:
<WFS_TransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xmlns="http://www.opengis.net/wfs" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd" xmlns:ogc="http://www.opengis.net/ogc"> <TransactionResult> <Status> <ERROR/> </Status> <Locator>Insert:polygons</Locator> <Message>Property conversion error on layer insert 'polygons'</Message> </TransactionResult> </WFS_TransactionResponse>
#2 Updated by Uroš Preložnik almost 2 years ago
1) QGIS project with WFS layers from test.level2.si server
2) points.sql data from PG (to see table structure, we are looking field name "type" with type integer, yes field name "type", not very original)
Steps to reproduce issue:
1. Open project
2. Edit point layer and reset value in field "type" to NULL for any feature.
3. Save changes and you will get Property Conversion error.
Another thing to note is that in database there are records with NULL value in "type" field, but QGIS shows them all as 0
#4 Updated by Alessandro Pasotti almost 2 years ago
- Status changed from Open to In Progress
- Pull Request or Patch supplied changed from No to Yes
- Affected QGIS version changed from 3.4.3 to 3.5(master)
This wasn't easy and I've fixed another bunch of issues along the way: