This error is thrown when trying to replace the media file.

$replacement->uri doesn't exist in media, it's $replacement->destination

Patch coming.

Comments

realityloop’s picture

patch attached

realityloop’s picture

Status: Active » Needs review
Cale Bierman’s picture

Status: Needs review » Postponed (maintainer needs more info)

I've tried adding a file using the Media Selector Widget and then replacing it with a new file and nothing has broken for me. This is without using the patch. Could you post some steps to replicate the issue?

Edit: I also used the the File widget

devin carlson’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

As with #3, I'm also not having any issues with file replacement and I'm not seeing any usage of $file->destination.

devin carlson’s picture

Issue summary: View changes

added more info

acbramley’s picture

Title: Notice: Undefined property: stdClass::$uri in file_entity_edit_submit() (line 696 of /Users/brian/Sites/vla-2.x/profiles/vlapubl » Notice: Undefined property: stdClass::$uri in file_entity_edit_submit()
Issue summary: View changes
Status: Closed (cannot reproduce) » Active

I have just come across this issue with my instance. I'm running the latest dev version of file_entity and an older version of media module (7.x-2.0-unstable7+64-dev) I'm experiencing the same issue where if I debug $file in file_entity_edit_validate() after the call to file_save_upload the file does not contain a uri property. This makes the replacement fail although the new replacement file is uploaded as a temporary file. Will debug into file_save_upload to see how it's losing the uri property.

acbramley’s picture

It seems like up until the file_save($file) in file_save_upload call the object has the uri parameter after which it drops off. Further debugging tracked it to directly after the module_invoke_all('entity_insert', $file, 'file'); in file_save() that the object no longer has a uri property. I suspect this is a contrib module doing something funny.

acbramley’s picture

Project: File Entity (fieldable files) » Pathauto Entity
Version: 7.x-2.x-dev » 7.x-1.x-dev

I tracked this down to the pathauto_entity module after disabling that the errors disappeared and my file was updated correctly! This was a module recently added to the site so would explain the sudden breakage of this functionality

acbramley’s picture

Bumping pathauto_entity to the full project version which is now available fixed my issues.

acbramley’s picture

Status: Active » Closed (fixed)