Skip to content
Permalink
Browse files
[Server] WFS Transaction fix insert
  • Loading branch information
rldhont committed Apr 9, 2017
1 parent 3be1bbd commit 6298cddb39d8a56b376077abaaff78325c9c8f4f
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/server/services/wfs/qgswfstransaction.cpp
@@ -124,7 +124,7 @@ namespace QgsWfs
errorCount += 1;
if ( action.handle.isEmpty() )
{
errorLocators << QStringLiteral( "Update:%1" ).arg( action.typeName );
errorLocators << QStringLiteral( "Delete:%1" ).arg( action.typeName );
}
else
{
@@ -143,7 +143,7 @@ namespace QgsWfs
errorCount += 1;
if ( action.handle.isEmpty() )
{
errorLocators << QStringLiteral( "Update:%1" ).arg( action.typeName );
errorLocators << QStringLiteral( "Insert:%1" ).arg( action.typeName );
}
else
{
@@ -646,10 +646,14 @@ namespace QgsWfs
}

// perform add features
if ( !vlayer->addFeatures( featureList ) )
if ( !provider->addFeatures( featureList ) )
{
action.error = true;
action.errorMsg = QStringLiteral( "Insert features failed on layer '%1'" ).arg( typeName );
if ( provider ->hasErrors() )
{
provider->clearErrors();
}
vlayer->rollBack();
continue;
}

0 comments on commit 6298cdd

Please sign in to comment.