Getting some empty queries from

$file = db_select('files', 'f')->fields('f', array('fid', 'uid', 'filename', 'filepath', 'filemime', 'filesize', 'timestamp', 'status'))->condition('fid', $fid)->execute()->fetchObject();

Fixed this with:

if(is_object($file)){

full error:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=1957&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO {file_managed} (fid, uid, filename, uri, filemime, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => private:// [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => ) in content_migrate_filefield_data_record_alter() (line 229 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/cck/modules/content_migrate/modules/content_migrate.filefield.inc).

Comments

jenlampton’s picture

Component: General » upgrade path
Status: Active » Needs review
StatusFileSize
new796 bytes

I'm having the same problem with

ResponseText: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null:

This patch prevented the error for me too, but I cleaned up the patch a little.

stephenrobinson’s picture

a much tidier alternative...

iamEAP’s picture

Status: Needs review » Reviewed & tested by the community

Works wonderfully for me! RTBC.

yched’s picture

Committed. Thanks !

yched’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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