After I updated my Drupal install with the latest modules, the functionality provided by the media update disappeared.
The field for entering new file on the file edit screen just wasn't present.

Here is my testing configuration:
Clean Drupal 7.9 install
Media 7.x-2.0-unstable2
File Entity 7.x-2.0-unstable2

In addition, if the file info is edited, there is issued a warning that says:

Warning: Parameter 1 to media_update_file_presave() expected to be a reference, value given in module_invoke_all() (line 818 of /Users/username/Sites/drupal/includes/module.inc).

Thank you.

Comments

shawn_smiley’s picture

At present this module has been implemented against the 1.x branch of the Media module. I'll create a 2.x branch for this module so that we can start working on compatibility with Media 2.x.

rob c’s picture

(just some feedback)

Hmmm i have the same error on a media 1.x dev setup...

I started out with the idea i wanted to confirm this bug issued by idenev, but i realized real quick this might be something else, but related, because i run media 1.x dev, so let me just post it here (and maybe change the title of the issue a bit to reflect implications instead of creating another issue?). (did media_update_file_presave in media 1.x change i wonder...)

When i visit a gallery, click on any media, click details, click edit and try to edit the url, i get:

* Warning: Parameter 1 to media_update_file_presave() expected to be a reference, value given in module_invoke_all() (line 818 of /includes/module.inc).
* Warning: Parameter 1 to media_update_file_presave() expected to be a reference, value given in module_invoke_all() (line 818 of /includes/module.inc).

Editing media from menu > content > media > edit random media trows me an: (same error)

* Warning: Parameter 1 to media_update_file_presave() expected to be a reference, value given in module_invoke_all() (line 818 of /includes/module.inc).
* Warning: Parameter 1 to media_update_file_presave() expected to be a reference, value given in module_invoke_all() (line 818 of /includes/module.inc).

and a new media entry with the update video link is created, existing media not updated.

I did not test this on media-1.0-rc2, i will later today. But i guess we will bump into this one on 1.x down the road somewhere, because against 1.x head it now is showing up, so let's report it.

(Also: when i tried to update a video already in the database with another video already in the database i got an SQL error, no fancy drupal message, but:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'youtube://v/videoid' for key 'uri' )

awm’s picture

Can you please tell me which versions of media and media update are compatible and been tested.
I tested Media 7.x-1.0-rc1 and media update-7.x-1.0 as well as media 7.x-1.0-rc2 and media update 7.x-2.x-dev
I keep getting this error when trying to replace an image in the library.

 Warning: Parameter 1 to media_update_file_presave() expected to be a reference, value given in module_invoke_all() (line 818 of C:\xampp\htdocs\sandbox\includes\module.inc).
    Warning: Parameter 1 to media_update_file_presave() expected to be a reference, value given in module_invoke_all() (line 818 of C:\xampp\htdocs\sandbox\includes\module.inc).
    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'temporary://Chrysanthemum.jpg' for key 'uri': UPDATE {file_managed} SET uid=:db_update_placeholder_0, filename=:db_update_placeholder_1, uri=:db_update_placeholder_2, filemime=:db_update_placeholder_3, filesize=:db_update_placeholder_4, status=:db_update_placeholder_5, timestamp=:db_update_placeholder_6, type=:db_update_placeholder_7 WHERE (fid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => 1 [:db_update_placeholder_1] => Chrysanthemum.jpg [:db_update_placeholder_2] => temporary://Chrysanthemum.jpg [:db_update_placeholder_3] => image/jpeg [:db_update_placeholder_4] => 879394 [:db_update_placeholder_5] => 1 [:db_update_placeholder_6] => 1324404785 [:db_update_placeholder_7] => image [:db_condition_placeholder_0] => 22 ) in drupal_write_record() (line 6888 of C:\xampp\htdocs\sandbox\includes\common.inc).
awm’s picture

changed function media_update_file_presave(&$file) to function media_update_file_presave($file) and worked for me.
Drupal 7 node hooks expect pass by value, not by reference.

See http://drupal.org/node/1010166

csevb10’s picture

Status: Active » Fixed

Re-open this ticket if it re-appears against 7.x-1.x-dev, but I've made the change from awm086 since $file is an object.
Thanks,
--Bill

Status: Fixed » Closed (fixed)

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