Skip to content

Commit

Permalink
[Server] WFS Transaction fix insert
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Apr 9, 2017
1 parent 3be1bbd commit 6298cdd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/server/services/wfs/qgswfstransaction.cpp
Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 6298cdd

Please sign in to comment.