Bug report #18056
New features are not added if attributes are not changed in new feature form dialog
|Affected QGIS version:||master||Regression?:||Yes|
|Operating System:||Windows 7 Professional 64bit||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25952|
I created geopackage layer and added three new fields:
date (type: QDateTime)
date_mod (type: QDateTime)
user (type QString(100))
and then I modified form properties (default values) for this new fields, as follows:
I chose for date field function now(), for date_mod function now() and check option "Apply deafault value on update", and for user field variable @user_full_name.
After then I created new feature and clicked OK button in the form of feature attributes.
Unfortunately after the changes were accepted, the new feature wasn't added.
I discovered that the problem lies in a fid field, which default value is Autogenerate.
The new feature is added if I clear the field using the cross button, and then clicked OK button.
I hope I expressed it clearly.
#2 Updated by Nyall Dawson almost 3 years ago
- Priority changed from Normal to High
- Subject changed from Problem with autogenarate fid during geopackage editing - QGIS 2.99 to New features are not added if attributes are not changed in new feature form dialog
The problem is more extensive than that - regardless of the layer, creating a new feature and clicking "OK" without changing any attributes in the dialog will result in the feature being discarded silently.