Tried with both Drupal 7.2 and 7.4.

When I update my modules and enable File Entity module I get the following error message:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'file_type': ALTER TABLE {file_managed} CHANGE `type` `type` VARCHAR(50) NOT NULL DEFAULT '' COMMENT 'The type of this file.', ADD INDEX `file_type` (`type`); Array ( ) in db_change_field() (line 2944 of /var/www/mysite/includes/database/database.inc).

Then I get a series of error messages on my pages, and now my media_gallery is broke:
* Notice: Undefined property: stdClass::$uri in file_styles_styles_filter() (line 33 of /var/www/mysite/sites/all/modules/styles/contrib/file_styles/file_styles.module).
* Notice: Undefined property: stdClass::$filemime in file_styles_styles_filter() (line 49 of /var/www/mysite/sites/all/modules/styles/contrib/file_styles/file_styles.module).
* Notice: Undefined property: stdClass::$uri in file_styles_styles_filter() (line 33 of /var/www/mysite/sites/all/modules/styles/contrib/file_styles/file_styles.module).
* Notice: Undefined property: stdClass::$filemime in file_styles_styles_filter() (line 49 of /var/www/mysite/sites/all/modules/styles/contrib/file_styles/file_styles.module).

I tried rolling my database/files right back to a stage before I installed Media and dependent modules (starting from scratch) but I got the following error messages when I installed the modules again and tried enabling Media and File Entity:
* Notice: Undefined index: bundles in field_info_bundles() (line 579 of /var/www/mysite/modules/field/field.info.inc).
* Warning: Invalid argument supplied for foreach() in _field_info_collate_fields() (line 216 of /var/www/mysite/modules/field/field.info.inc).
* Notice: Undefined index: field_name in field_update_instance() (line 522 of /var/www/mysite/modules/field/field.crud.inc).
* Notice: Undefined index: field_name in field_update_instance() (line 524 of /var/www/mysite/modules/field/field.crud.inc).
* FieldException: Attempt to update an instance of a nonexistent field . in field_update_instance() (line 524 of /var/www/mysite/modules/field/field.crud.inc).

I have installed the following related modules:
Media (File entity too with Media Beta 5)
Media Browser plus
Media gallery
Media Internet Sources
Multiple forms
File Styles
Styles
Styles UI

Any support would be much appreciated.

Comments

mesr01’s picture

Same here. I got the following errors while updating the database (update.php):

Notice: Undefined index: bundles in field_info_bundles() (line 576 of /path/to/d7/modules/field/field.info.inc).
Warning: Invalid argument supplied for foreach() in _field_info_collate_fields() (line 215 of /path/to/d7/modules/field/field.info.inc).
Notice: Undefined index: bundles in field_info_bundles() (line 576 of /path/to/d7/modules/field/field.info.inc).
Warning: Invalid argument supplied for foreach() in _field_info_collate_fields() (line 215 of /path/to/d7/modules/field/field.info.inc).
Carlos Miranda Levy’s picture

I got the same notices when upgrading.

dlumberg’s picture

I got these running update.php

Notice: Undefined index: vocabulary in entity_metadata_field_term_reference_callback() (line 117 of /path/to/drupal/sites/all/modules/entity/modules/field.info.inc).
Notice: Undefined index: file in field_views_field_default_views_data() (line 222 of /path/to/drupal/sites/all/modules/views/modules/field.views.inc).
Notice: Undefined index: vocabulary in taxonomy_field_views_data() (line 415 of /path/to/drupal/sites/all/modules/views/modules/taxonomy.views.inc).

With the return value

Failed: FieldException: Attempt to update an instance of a nonexistent field field_image_field. in field_update_instance() (line 522 of /path/to/drupal/modules/field/field.crud.inc).

And when I try to load the manage fields page for content that has "field_image_field" I get

Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled:
Image Field (field_image_field) field requires the Media file selector widget provided by media module
sapelzin’s picture

I have the same problems as others, and Galleries are broken as well...

Trying to get property of non-object in theme_media_gallery_block_thumbnail() (line 353 of /home/ace1950/public_html/sites/all/modules/media_gallery/media_gallery.theme.inc).

madeby’s picture

Got same error, any suggestions?

Tuscan’s picture

So I can't uninstall Media beta 4 else that screws up the database due to an earlier bug right? And if I update to Beta 5, the moment I try to enable "File entity" module (that beta 5 comes with and now depends on) I just get this pop up error:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'file_type': ALTER TABLE {file_managed} CHANGE `type` `type` VARCHAR(50) NOT NULL DEFAULT '' COMMENT 'The type of this file.', ADD INDEX `file_type` (`type`); Array ( ) in db_change_field() (line 2944 of /var/www/mysite/includes/database/database.inc).

Then I get a series of error messages on my pages that look like this:
* Notice: Undefined property: stdClass::$uri in file_styles_styles_filter() (line 33 of /var/www/mysite/sites/all/modules/styles/contrib/file_styles/file_styles.module).
* Notice: Undefined property: stdClass::$filemime in file_styles_styles_filter() (line 49 of /var/www/mysite/sites/all/modules/styles/contrib/file_styles/file_styles.module).

So.. i'v hit a dead end..

1. Is anyone else seeing these particular errors? If so which ones?
2. Does anyone know what might be the cause?
3. Are they fixable? Or should I need to roll back my site?

Even if I do roll back my site to a state before Media was installed, I still get these errors when I enable Media Beta 5 + File Entity:
Notice: Undefined index: bundles in field_info_bundles() (line 579 of /var/www/mysite/modules/field/field.info.inc).
Warning: Invalid argument supplied for foreach() in _field_info_collate_fields() (line 216 of /var/www/mysite/modules/field/field.info.inc).

Great module btw, but really hope this can be easily resolved..

Aciid’s picture

Well it says on the project statement, that some of the dev snapshots contain queries and functions that are "non-backwards-compatible".
Also the betas seem not to have been thoroughly tested, before releasing. So from now on , remember to backup your data and especially databases before upgrading.

If you are coming from B4->B5, remember to enable the File Entity module that should fix some error messages at least.

dcartman’s picture

This seems to be the same problem as this one:
http://drupal.org/node/1210178#comment-4704284

lsolesen’s picture

+1

kscott22’s picture

Similar issues here (see below). I backed up everything, but I'd prefer not to roll back if this can be fixed. Any ideas are MUCH appreciated.

When uploading or linking new media, through wysiwyg:
•	Warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an array in media_gallery_media_wysiwyg_allowed_view_modes_alter() (line 1506 of /xxx/sites/all/modules/media_gallery/media_gallery.module).
•	Notice: Trying to get property of non-object in media_format_form () (line 290 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Undefined index: file in media_format_form() (line 291 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Trying to get property of non-object in media_format_form() (line 290 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Undefined index: file in media_format_form() (line 291 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Trying to get property of non-object in media_format_form() (line 290 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Undefined index: file in media_format_form() (line 291 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Trying to get property of non-object in media_format_form() (line 290 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Undefined index: file in media_format_form() (line 291 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Trying to get property of non-object in media_format_form() (line 290 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Undefined index: file in media_format_form() (line 291 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Notice: Undefined variable: formats in media_format_form() (line 303 of /xxx/sites/all/modules/media/includes/media.filter.inc).
•	Exception: Unable to continue, no available formats for displaying media. in media_format_form() (line 304 of /xxx/sites/all/modules/media/includes/media.filter.inc).
Doubt it's related, but additionally, I'm getting these errors after running update.php:
•	Notice: Undefined index: fieldable in field_ui_menu() (line 71 of /xxx/modules/field_ui/field_ui.module).
•	Notice: Undefined index: label in rules_entity_type_options() (line 282 of /xxx/sites/all/modules/rules/modules/entity.rules.inc).
•	Notice: Undefined index: controller class in entity_type_supports() (line 68 of /xxx/sites/all/modules/entity/entity.module).
•	Warning: class_implements() [function.class-implements]: object or string expected in entity_type_supports() (line 68 of /xxx/sites/all/modules/entity/entity.module).
•	Warning: in_array() [function.in-array]: Wrong datatype for second argument in entity_type_supports() (line 68 of /xxx/sites/all/modules/entity/entity.module).
•	Notice: Undefined index: bundles in field_info_bundles() (line 576 of /xxx/modules/field/field.info.inc).
•	Warning: Invalid argument supplied for foreach() in _field_info_collate_fields() (line 215 of /xxx/modules/field/field.info.inc).
Also think this is unrelated, but just in case, on Calendars:
Notice: Undefined index: fieldable in field_ui_menu() (line 71 of /xxx/modules/field_ui/field_ui.module).
thorn’s picture

I also got the errors. Will these be worked around quickly or should I rather focus on getting my site back to an earlier state?

A small suggestion for the Drupal Update process, could be a warning system that warns users about updating a module or theme, which is not backwards-compatible. It will spare a lot of developers trouble when setups is crashing.

/Thorn

Carlos Miranda Levy’s picture

Backup, backup, always backup before doing updates, in particular with modules in beta, dev, with warnings by developers, multiple dependencies and when going from one version to another.

I was able to restore to my previous state with the backup database and downloaded the old versions of the modules and will patiently wait ... this modules is mostly the almost right solution for a long-awaited functional, well integrated and flexible gallery module for Drupal (believe I've tried most of the gallery modules and recipes over the years and this one almost has it right ;-).

Tuscan’s picture

I have decided to remove the Media module and roll back for now until it is a bit more stable. Don't want to build a site, then later update the Media module to a newly released version to find its broke my site and I need to roll right back to 3 months ago before I installed it :-/

Is there any ETA yet on a stable release? Cause the module itself is great, just needs a lot of stability improvements.

anj’s picture

I didn't get these errors, but upgrading the database from beta4 to beta5 broke private downloads. The file download was skipped by file_file_download, but image_file_download no longer recognised the files as downloadable by image.module and passed the download back to file_file_download, which skipped the download again, leading to a "Page not found error".

Should I submit this as a separate bug?

Tuscan’s picture

When a new version of Media is released, we should wait until the other dependent modules like Media Gallery have caught up, and then update them all at the same time.
Otherwise you will find yourself with dependent modules that are not compatible with the latest Media module (which will cause all kinds of problems). If you check Media Gallery you will notice this was updated yesterday, I think this is now compatible with Media Beta 5.

Im still going to hold off now though until all the Media modules are a bit more stable. Don't suppose anyone knows when Beta 6 will be due for release? Or even better, 1.0?

aaron’s picture

@anj: yes, please, report that as a different bug. there's already too much on this ticket, don't want that to get lost in the shuffle.

aaron’s picture

@kscott22: I think that's also a different issue than the original report, if i read that correctly.

mesr01’s picture

Just for the record, I rolled back the database following the issue and then waited for the new release of Media Gallery as Tuscan suggested. I could then update both modules at once and everything went smoothly this time.

aaron’s picture

@kscott22: is there any chance you're using one or more of the following modules: mobile tools, rules, field collection, entity? and/or a module that implements hook_boot() or hook_module_implements_alter()? i'm tracking down an odd conflict that seems to indicate one or more of these causing problems. which may actually be a core bug; see #1224956: hook_module_implements_alter ignored in earlier phases of bootstrap.

kscott22’s picture

@aaron: I'm using both rules and entity. I just upgraded media browser plus and entity, and the errors have stopped.

robeano’s picture

Status: Active » Closed (works as designed)

The PDOException relates to the recreation of an index on 'file_type' that basically moved from media module and into the file_entity module. You can ignore that issue.

The PHP Notices relate to the Styles module. At this time, it is recommended that you do not use the Styles module with media and media gallery modules.

There are no fixes for us to make for this upgrade path. Closing ticket.