Bug report #16785
Constraint prevent adding feature to spatialite layer with auto-increment pkey
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | - | ||
Category: | Edit widget | ||
Affected QGIS version: | master | Regression?: | Yes |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 24684 |
Description
1. Create a spatialite layer with an auto-incrementing primary key
2. Turn editing on
3. Add feature
=> the pkuid field is invalid with a NULL value but you cannot edit it.
History
#1 Updated by Denis Rouzaud over 7 years ago
#2 Updated by Darek Bobak over 7 years ago
It is possible to add pkuid manualy (QGIS master on Windows 10). But, QGIS does not add it automatically, which is definitely undesirable behaviour
#3 Updated by Denis Rouzaud over 7 years ago
On my side, I can't validate the form, see the attached screenshot (apply is disabled).
#4 Updated by Darek Bobak over 7 years ago
- File field_properties.png added
Did you try to manually write something in the pkuid field? And check, if the field properties allow edition of the field (see attached image).
In the meantime, I've found the way to make QGIS automatically fill that field with increment value. You have to insert and expression:
$id
in the "Default value" field in the properties of the field.
#5 Updated by Denis Rouzaud over 7 years ago
nope, but if it's the solution, it should be done automatically!
#6 Updated by Darek Bobak over 7 years ago
I agree.
#7 Updated by Giovanni Manghi over 7 years ago
- Status changed from Open to Feedback
does this affect only master/qgis3, correct?
#8 Updated by Denis Rouzaud over 7 years ago
Yes Master.
But why feedback? For me it's a serious blocker.
#9 Updated by Giovanni Manghi over 7 years ago
- Status changed from Feedback to Open
Denis Rouzaud wrote:
Yes Master.
But why feedback? For me it's a serious blocker.
the status does not indicates the seriousness: feedback just means that the ticket is open and a question awaiting an answer has been posted. Seriousness is give by the priority field, and by the "regression" field.
#10 Updated by Denis Rouzaud almost 7 years ago
- Status changed from Open to Closed
fixed in 73674e8157925df6979485cf36804c6e252d03a1
#11 Updated by Giovanni Manghi over 6 years ago
- Resolution set to fixed/implemented