The update failed on a site with this message:

Update #7208
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'type' cannot be null: INSERT INTO {file_type} (type, label, description) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => ) in file_type_save() (line 541 of /var/www/drupal7/sites/all/modules/file_entity/file_entity.file_api.inc).

CommentFileSizeAuthor
#4 update_to_unstable7.patch2.04 KBlogaritmisk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ParisLiakos’s picture

Version: 7.x-2.0-unstable7 » 7.x-2.x-dev
Priority: Normal » Critical

Thats why

if ($new_type = file_type_load($type->name)) {
  $new_type->mimetypes = array_merge($type->mimetypes, $new_type->mimetypes);
  $new_type->streams = array_merge($type->streams, $new_type->streams);
}
file_type_save($new_type);
chriscohen’s picture

@rootatwc, can you be a bit more verbose please? This really doesn't mean a lot to me!

ParisLiakos’s picture

it was more a note to myself, when i have time to create patch.
if you located this piece of code in media.install can you add this

else {
  $new_type = $type;
}

right before

file_type_save($new_type);

and try to upgrade again?

logaritmisk’s picture

Status: Active » Needs review
FileSize
2.04 KB

I had to unset 'default' from existing_types, for some very strange reason the if statement wasn't respected. And I didn't have the 'document' type so I wrapped that in a if statement as well.

ParisLiakos’s picture

Status: Needs review » Fixed

committed it with a few changes..thanks didnt cross my mind that document might not be there
http://drupalcode.org/project/media.git/commit/fa663c3

Status: Fixed » Closed (fixed)

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