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@14007 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 4, 2010
1 parent 32648f6 commit 35dd014adfc323015d0b41d5bd21cda9bbf6687c
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 35dd014

Please sign in to comment.