Skip to content
Permalink
Browse files
Always save newly created features, even if no attributes are
modified in the form popup after feature creation

Fixes #18056
  • Loading branch information
nyalldawson committed Feb 9, 2018
1 parent fcb50a6 commit 9da5fd3
Showing 1 changed file with 18 additions and 1 deletion.
@@ -572,9 +572,26 @@ bool QgsAttributeForm::saveMultiEdits()

bool QgsAttributeForm::save()
{
if ( mIsSaving || !mDirty )
if ( mIsSaving )
return true;

// only do the dirty checks when editing an existing feature - for new
// features we need to add them even if the attributes are unchanged from the initial
// default values
switch ( mMode )
{
case SingleEditMode:
case MultiEditMode:
if ( !mDirty )
return true;
break;

case AddFeatureMode:
case SearchMode:
case AggregateSearchMode:
break;
}

mIsSaving = true;

bool success = true;

0 comments on commit 9da5fd3

Please sign in to comment.