get in every case if not valid the copy of the value

even if unique constraint because it checks if existent - otherwise it get's null there
This commit is contained in:
signedav 2018-10-15 10:26:36 +02:00
parent e8c15a9c46
commit d62eb6e4d8

View File

@ -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