Skip to content

Commit

Permalink
get in every case if not valid the copy of the value
Browse files Browse the repository at this point in the history
even if unique constraint because it checks if existent - otherwise it get's null there
  • Loading branch information
signedav committed Oct 15, 2018
1 parent e8c15a9 commit d62eb6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/qgsvectorlayerutils.cpp
Expand Up @@ -424,6 +424,14 @@ QgsFeature QgsVectorLayerUtils::createFeature( const QgsVectorLayer *layer, cons
}
}

// 5. passed attribute value
// note - deliberately not using else if!
if ( !v.isValid() && attributes.contains( idx ) )
{
v = attributes.value( idx );
}


// last of all... check that unique constraints are respected
// we can't handle not null or expression constraints here, since there's no way to pick a sensible
// value if the constraint is violated
Expand Down

0 comments on commit d62eb6e

Please sign in to comment.