Proper handling of null and undefined attribute values in WFS transactions. r=ahocevar (closes #2222)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9615 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -254,9 +254,11 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
|
||||
// add in attributes
|
||||
for(var key in feature.attributes) {
|
||||
this.writeNode(
|
||||
"Property", {name: key, value: feature.attributes[key]}, node
|
||||
);
|
||||
if(feature.attributes[key] !== undefined) {
|
||||
this.writeNode(
|
||||
"Property", {name: key, value: feature.attributes[key]}, node
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// add feature id filter
|
||||
@@ -269,7 +271,9 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
"Property": function(obj) {
|
||||
var node = this.createElementNSPlus("wfs:Property");
|
||||
this.writeNode("Name", obj.name, node);
|
||||
this.writeNode("Value", obj.value, node);
|
||||
if(obj.value !== null) {
|
||||
this.writeNode("Value", obj.value, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
"Name": function(name) {
|
||||
|
||||
Reference in New Issue
Block a user