I refer to this block in modules/contrib/filefield.inc, lines 23-25, within the filefield_migrate_prepare_node function:

elseif (isset($fields[$source_key]['default_value']) && $fields[$source_key]['default_value'] != '') {
  $source_file = $fields[$source_key]['default_value'];
}

As near as I can tell, there is no $fields variable in the scope of this function. I think you meant to refer to $tblinfo->fields. It seems that it should be:

elseif (isset($tblinfo->fields[$source_key]['default_value']) && $tblinfo->fields[$source_key]['default_value'] != '') {
  $source_file = $tblinfo->fields[$source_key]['default_value'];
}

Otherwise I don't understand what this part of the code it trying to accomplish.

CommentFileSizeAuthor
#3 673362.patch1 KBstella

Comments

mikeryan’s picture

Component: Code » Contrib module support
mikeryan’s picture

Project: Migrate » Migrate Extras
Version: 6.x-1.x-dev » master
Component: Contrib module support » Code

Filefield support has been moved to the migrate_extras module.

stella’s picture

Component: Code » Migrate Extras Features
Status: Active » Needs review
StatusFileSize
new1 KB

I had the same problem. However, I don't think there is any need for this bit of code which checks if a field mapping or a default value have been provided. All of this has already been done by the migrate module and it's populated the $node object with the field setting. Attached patch fixes this.

frankcarey’s picture

Status: Needs review » Fixed

committed patch to dev

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.