Skip to content
Permalink
Browse files
Don't add empty attribute fields to the insert statement in wfs-t (so…
…me servers complain about it)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14007 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 4, 2010
1 parent 4090e06 commit f49931bcac3cca3c32cf5749a4dd9b582dc23954
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/providers/wfs/qgswfsprovider.cpp
@@ -261,10 +261,14 @@ bool QgsWFSProvider::addFeatures( QgsFeatureList &flist )
QgsAttributeMap::const_iterator valueIt = featureAttributes.find( fieldIt.key() );
if ( valueIt != featureAttributes.constEnd() )
{
QDomElement fieldElem = transactionDoc.createElementNS( mWfsNamespace, fieldIt.value().name() );
QDomText fieldText = transactionDoc.createTextNode( valueIt.value().toString() );
fieldElem.appendChild( fieldText );
featureElem.appendChild( fieldElem );
QVariant fieldValue = valueIt.value();
if ( fieldValue.isValid() && !fieldValue.isNull() )
{
QDomElement fieldElem = transactionDoc.createElementNS( mWfsNamespace, fieldIt.value().name() );
QDomText fieldText = transactionDoc.createTextNode( fieldValue.toString() );
fieldElem.appendChild( fieldText );
featureElem.appendChild( fieldElem );
}
}
}

@@ -2003,6 +2007,7 @@ bool QgsWFSProvider::sendTransactionDocument( const QDomDocument& doc, QDomDocum
QByteArray response = reply->readAll();
reply->deleteLater();
serverResponse.setContent( response, true );

return true;
}

0 comments on commit f49931b

Please sign in to comment.