Skip to content

Commit

Permalink
Always save newly created features, even if no attributes are
Browse files Browse the repository at this point in the history
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.
19 changes: 18 additions & 1 deletion src/gui/qgsattributeform.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 9da5fd3

Please sign in to comment.