Active
Project:
Embedded Media Field
Version:
6.x-2.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Oct 2011 at 16:55 UTC
Updated:
13 May 2012 at 19:39 UTC
Jump to comment: Most recent file
Comments
Comment #1
arthurf commentedSounds like this is an issue with emfield not media mover.
Comment #2
kobnim commentedI am having the same problem. Here are steps to duplicate the problem:
I. Set-up
- create a node-type containing a filefield an an emfield.
- create this mediamover config:
-- harvest: harvests files from the filefield,
-- process: upload harvested files to youtube
-- complete: populate emfield with the youtube url
II. Run-time
- user creates a node and uploads a file
- system runs the mediamover config, which populates the emfield with the youtube url.
- admin goes to admin/content/node and deletes the node
Result:
- warning: unserialize() expects parameter 1 to be string, array given in emfield.cck.inc on line 87
The problem happens inside function
_emfield_emfield_field(), $op='load'.The function expects $items[$delta]['data'] to be a string, but it is instead is an array:
$items[$delta]['data'] = array(0 => FALSE)I was able to resolve the problem by replacing:
$data = (array)unserialize($items[$delta]['data']);with:
I am attaching a patch, though I am not sure this is the right solution, because I do not understand what is causing
$items[$delta]['data']to be an array rather than a string.Comment #3
kobnim commentedAfter further investigation, I found that the source of the problem was in the media_mover module. One of the media_mover contrib modules, mm_emfield.module, calls node_save() while node_delete() is executing, and this causes a bunch of problems including the "unserialize" warning. See here for more details:
http://drupal.org/node/1540278
Nonetheless, it may still be a good idea to modify _emfield_emfield_field() (as in the patch submitted above) to allow for the possibility that $items[$delta]['data'] is not a string.