I am using mm_youtube which would return a youtube url and not a file from its action ... (Currently I think in its step it just returns the $the_youtube_id... I changed it so it returns http://www.youtube.com/watch?v=$the_youtube_id as I think you need the full url to work with )
...
Anyway, I want to store that back to cck, or create a new node... right now just trying the new node option ('Store: Save to a node'), and it doesn't save the url to the emfield ...
First I think maybe on line 333 of mm_node.node.inc:
$node->{$field['field_name']}[0] = $item;
should that be...
$node->{$field['field_name']}[] = $item;
in case doing a multiple file to multiple emfield?
Also, I think Media Mover saves a reference to the file (when you click edit on the node which has the emvield, it has in the Media Mover linked files section a reference to the 'file' youtube.com url)?
Not sure if this is correct as its not really a 'file' but i guess you could have a reference to it as long as not trying to Delete it later which it will error since file doesn't exist.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1039186.patch | 880 bytes | darrick |
Comments
Comment #1
arthurf commentedYes, this is correct. A step function needs to return TRUE or a $filepath for success or FALSE.
Yes, this code should have matched the image/fielfield code above it. Fix is committed
Any Media Mover action that saves or selects a file to/from a node will save the NID. Those files will be attached to $node->media_mover. This is important for uniqueness checking (don't select the same file twice) file handling outside of CCK etc.
Without getting overly technical, yes it should be considered a file. Note that D7 has gone to URI's for all files and there are modules which are implementing stream wrappers which allow you to reference files by things like youtube://filename
Media Mover can handle deletion of material, unfortunately that functionality has not been implemented for any of the mm_node functions. See: http://drupal.org/node/566870 for the incomplete documentation. More stuff for the todo list.
Comment #2
armyofda12mnkeys commentedGotcha. thanks for explaining all these things...
I tried latest version commited on 26th and it couldnt save the youtube to cck when tried to create a new node...
Latest mm_youtube file attached here: http://drupal.org/node/1030894#comment-4003624
It returns the full youtube url correctly now.
The new node gets created without any errors, however it doesn't get the cck field(s) filled out.
Comment #3
armyofda12mnkeys commentedTried latest file today too and got same result. The cck field never gets populated.
Comment #4
armyofda12mnkeys commentedStill can't store the youtube hyperlink I return to emvideo cck. So I just converting my file and saving back to the original node's cck and telling user it uploads to youtube too (but doesn't embed to youtube video).
It also errors when you ->delete() in mm_node line 338 i think. Then again its not a file, but a hyperlink so maybe that can't be fixed unless setup a way to have each module clean up its own file.
Comment #5
darrick commentedI found the mm_node module wasn't attaching the file to the node for emfields. I've attached a patch but I've only tested it with the zzz_custom_url provider.
Comment #6
arthurf commentedThanks for the patch. Committed and ready for testing.
Comment #7
arthurf commented