Bug report #18056

New features are not added if attributes are not changed in new feature form dialog

Added by Jadwiga Trojak about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Forms
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

Description

Hi,
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.

Associated revisions

Revision 9da5fd32
Added by Nyall Dawson about 6 years ago

Always save newly created features, even if no attributes are
modified in the form popup after feature creation

Fixes #18056

History

#1 Updated by Nyall Dawson about 6 years ago

  • Regression? changed from No to Yes

#2 Updated by Nyall Dawson about 6 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.

#3 Updated by Nyall Dawson about 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#4 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF