Skip to content
Permalink
Browse files

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
  • Loading branch information
signedav committed Oct 15, 2018
1 parent e8c15a9 commit d62eb6e4d874923d858975f941aa4ecd965899d8
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/core/qgsvectorlayerutils.cpp
@@ -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

0 comments on commit d62eb6e

Please sign in to comment.
You can’t perform that action at this time.