I have a nodetype containing both a multi-valued filefield and a multi-valued emvideo field.
And I have a media-mover configuration that:
(a) harvests all the files in the multi-valued filefield
(b) uploads the files to youtube
(c) saves the youtube videos in the emvideo field.

Steps (a) and (b) work fine. But I am having a problem with the save-step (c).
All the youtube videos are getting stuffed into the first emvideo field, overwriting what was there before.

I would instead like to append the processed videos to the end of the multi-valued emvideo field. Is this possible?

CommentFileSizeAuthor
#5 mm_emfield.diff491 byteskobnim
#1 mm_emfield.patch741 bytesarthurf

Comments

arthurf’s picture

Category: feature » bug
StatusFileSize
new741 bytes

I think what you are identifying is actually a bug rather than a feature. Looking at mm_emfield, the field position is hard coded on line 354. The code in mm_cck is quite a bit different:


  // Add the file on to the node
  // Do any files already exist on this node?
  if (! is_array($node->{$field['field_name']})) {
    $node->{$field['field_name']} = array($new_file);
  }
  elseif (! isset($node->{$field['field_name']}[0]))  {
    $node->{$field['field_name']} = array($new_file);
  }
  // Files exist, append this file
  else {
    $node->{$field['field_name']}[] = $new_file;
  }

Can you apply the attached patch to mm_emfield.module and see if that works for you?

kobnim’s picture

The patch worked perfectly. Thank you!

arthurf’s picture

Fix is committed, thanks for testing!

arthurf’s picture

Status: Active » Closed (fixed)
kobnim’s picture

Status: Closed (fixed) » Active
StatusFileSize
new491 bytes

This patch never made it into media_mover_api-6.x-1.0-beta9.
I am attaching a patch for the beta9 version of mm_emfield.module

arthurf’s picture

Version: 6.x-1.0-beta7 » 6.x-1.x-dev
Status: Active » Needs review

This is actually in the 6.x-1.x branch. It should be ready for testing.

kobnim’s picture

I tested the patch and it works fine.
There have been a lot of fixes since the beta9 release of 6.x-1.0. If you could roll the changes of the past year into another official release, that would be really helpful.
Thanks very much for all your work on this great module!
MIndy