I wonder what's the reason for filtering attributes in

function aws_simpledb_build_attributes_array($attributes, $replace = FALSE) {
  // Remove empty values from array.
  $attributes = array_filter($attributes);

...
}

Discovered this bug when tried to overwrite a non-empty value in SDB with a numeric "0". Before converting to string, this function deletes the numeric "0" values because it consider them as FALSE. See http://www.php.net/array_filter

So, why filtering there?

CommentFileSizeAuthor
#1 aws-sdb-filter-905258.patch495 bytesclaudiu.cristea

Comments

claudiu.cristea’s picture

Status: Active » Needs review
StatusFileSize
new495 bytes

I can see the reason on new record, to not save empty columns. But when invoking aws_simpledb_put_attributes() to replace values on an existing record, it simply let the old values for those fields when trying to set them to "0".

Attached, a simple patch that remove array filtering.

davisben’s picture

Version: » 6.x-1.x-dev
Issue summary: View changes
Status: Needs review » Closed (outdated)