I'm running a multisite drupal with 3 sites and I have run into a problem on all three sites: I can't rename any files in the media library. I get errors whether I use the Gallery editor to try to change the names, or when I go to the Drupal media edit page and try to edit each one individually.

I get the following message every time I try to save an edit:

Error

Error message

• Notice: Undefined index: file in media_edit_submit() (line 366 of /*****/sites/all/modules/media/includes/media.pages.inc).
• EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7633 of /*****/includes/common.inc).

The website encountered an unexpected error. Please try again later.

This is a big problem, as our sites use a lot of media, and we don't want to have all the file names be IMGxxx and DSCxxx. We can change the media we upload from now, but we have to rename these older galleries too. Any ideas?