Commit 73e12cc4 authored by yched's avatar yched
Browse files

Issue #1369658 by SangersDrupalDude, jenlampton: Fixed 'Integrity constraint...

Issue #1369658 by SangersDrupalDude, jenlampton: Fixed 'Integrity constraint violation - Column 'uid' cannot be null' if unknown file during filefield/imagefield migration
parent 236e9d5d
......@@ -200,7 +200,16 @@ function content_migrate_filefield_data_record_alter(&$record, $field, $instance
return;
};
$file = db_select('files', 'f')->fields('f', array('fid', 'uid', 'filename', 'filepath', 'filemime', 'filesize', 'timestamp', 'status'))->condition('fid', $fid)->execute()->fetchObject();
$file = db_select('files', 'f')
->fields('f', array('fid', 'uid', 'filename', 'filepath', 'filemime', 'filesize', 'timestamp', 'status'))
->condition('fid', $fid)
->execute()
->fetchObject();
// In case of unknown file, just abort.
if (!is_object($file)) {
return;
}
$basename = variable_get('file_directory_path', conf_path() . '/files');
$scheme = file_default_scheme() . '://';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment