@@ -1168,6 +1168,9 @@ QDomDocument QgsWFSServer::transaction( const QString& requestBody )
1168
1168
typeName = actionElem.attribute ( " typeName" );
1169
1169
}
1170
1170
1171
+ if ( typeName.contains ( " :" ) )
1172
+ typeName = typeName.section ( " :" , 1 , 1 );
1173
+
1171
1174
QDomNodeList typeNameList = mDocElem .elementsByTagName ( typeName );
1172
1175
if ( typeNameList.count () == 0 )
1173
1176
{
@@ -1424,13 +1427,12 @@ QDomDocument QgsWFSServer::transaction( const QString& requestBody )
1424
1427
}
1425
1428
// Add the feature to th layer
1426
1429
// and store it to put it's Feature Id in the response
1427
- layer->addFeature ( *f, true );
1428
- inFeatList << *f;
1430
+ inFeatList.append ( *f );
1429
1431
}
1430
1432
}
1431
1433
}
1432
1434
// Commit the changes of the insert elements
1433
- if ( !layer-> commitChanges ( ) )
1435
+ if ( !provider-> addFeatures ( inFeatList ) )
1434
1436
{
1435
1437
QDomElement trElem = doc.createElement ( " TransactionResult" );
1436
1438
QDomElement stElem = doc.createElement ( " Status" );
@@ -1444,6 +1446,13 @@ QDomDocument QgsWFSServer::transaction( const QString& requestBody )
1444
1446
trElem.appendChild ( locElem );
1445
1447
1446
1448
QDomElement mesElem = doc.createElement ( " Message" );
1449
+ QStringList mesErrors;
1450
+ mesErrors << QString ( " ERROR: %n feature(s) not added." ).arg (inFeatList.size ());
1451
+ if ( provider->hasErrors () )
1452
+ {
1453
+ mesErrors << " \n Provider errors:" << provider->errors ();
1454
+ provider->clearErrors ();
1455
+ }
1447
1456
mesElem.appendChild ( doc.createTextNode ( layer->commitErrors ().join ( " \n " ) ) );
1448
1457
trElem.appendChild ( mesElem );
1449
1458
0 commit comments