The assignment $result = $data[0][$column]; , as well as the analogous ones in the other export handlers, will fail if the field has the following structure: $field_name[$lang] = NULL, which is the case for some empty fields.

count($data) should be checked prior to doing an assignment. I have code for this, just need to incorporate it back into the main branch.

CommentFileSizeAuthor
#4 1333164_export_data_array.patch556 bytesrrbambrey

Comments

kostajh’s picture

Can you post a patch for your code or highlight where and in what files the change should be made? Thanks!

kostajh’s picture

nicodv’s picture

I'm getting the error
Notice: Undefined offset: 0 in sf_entity_export_field_default()

Should i wrap the code with if (count($data) > 0) {
}
everywhere?

any patch for this?

thanks

nico

rrbambrey’s picture

Status: Active » Needs review
StatusFileSize
new556 bytes

Hi,

Attached a patch to cover the issue in sf_entity.module not sure where else this might appear as yet.
Also not sure as to whether returning FALSE is correct.
Patched against latest 7.x-2.x

kostajh’s picture

Status: Needs review » Closed (won't fix)