Closed (fixed)
Project:
Media Mover
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jun 2009 at 11:32 UTC
Updated:
20 Apr 2010 at 15:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
szczym commentedi just recreated that bug on other, plain drupal instalation.
if its need i can supply ssh access to that sandbox
Comment #2
trofimchouk commentedTry to test your FFMpeg-Wrapper module:
- go to admin/settings/ffmpeg_wrapper/test
- place some file into test direcotry
- refresh page
- choose 'use' in file list
- choose output format
- transcode
In my case there was an error while audio transcoding from avi to flv. I checked 'use advanced settings' and set sample rate to 44 (there was an ffmpeg error about audio sample rate). And now it works!
Comment #3
szczym commentedffmpeg works, actually any setup works fine when i make it first.
Problem is: any media mover config, that was made after the first one is not submitting results into cck filefiled (but processing works, its in logs and files are made ok).
Comment #4
szczym commentedthe issue is similar (but not identical) to #368956: Error saving to filefield in cron
Im changing it to critical, as its serous stopper for many websites.
Comment #5
szczym commentedComment #6
jzornig commentedI have the same issue. I have two MM configs. One creates a thumb, the other transcodes the video. Both place the created files into CCK filefields. If only one config is enabled, it works. Either thumb or transcode succeeds. If both are enabled I only get the thumb attached. The transcoded video is created but not added to the CCK field.
Comment #7
venkiparam commentedAny updates, I am having the same issue, Transcoded files are not getting saved to cck filefield.
Comment #8
venkiparam commentedOk, I took some time to probe through the code and found a spot where i think the problem is.
Its in the mm_cck.module on line number 57 - 59 in function mm_cck_media_mover, source looks like this
case 'complete':
case 'storage':
return mm_cck_node_save($action, $configuration, $file);
The problem is whenever you run a configuration, the function called for storage & complete (verbs) is the same. The problem occurs because the " storage " routine properly stores the data in the cck filefield but the " complete " routine overwrites the previous entry and hence the filefield association is completely lost.
To get a successful result (That is, the converted file gets properly attached to the cck field), try setting " bypass this operation " in the complete step or use some other operation other than the cck provided one and all works well.
Hope i am sufficiently clear for the maintainer to understand.Pardon me, this is the first time i have probed a drupal module and may be my language is not proper too.
Venkiparam
Comment #9
szczym commentedvenkiparam: im having in 2 configs the "complete" set on "Media Mover defaults: Bypass this operation" and its still not adding icons into cck, plus its running the configs any time i run cron...
:/
could you post your working configs ?
Comment #10
venkiparam commentedAttached an export of the working config file. This config does nothing more than Transcoding the input file using ffmpeg and attaching it to cck field. And for the Cron issue, Make sure u have unchecked the option "Run Media Mover on cron runs" under the "Run Control" section on the settings screen (admin/build/media_mover/settings).
Comment #11
szczym commentedThe issue concerns 2 mm configs: for example first for encoding and second for generating thumbnails. Problem is one of mm configs is not adding effects into the cck file filed.
The "Run Media Mover on cron runs" setting is essential for any production site.
Comment #12
venkiparam commentedHi you were right, This is happening to me too. But i feel this is very similar #8 which i have posted above, but the issue is not with using "mm_cck_node_save()" for both storage & complete. The issue is with the mm_cck_node_save() function itself.
If you go down the call hirearchy, The function " mm_cck_field_filefield() " gets called when the field type is filefield. I tried putting a debug statement just before node_save($node) inside " mm_cck_field_filefield() " and found few interesting thing. I have attached the output to this reply. For clarity purpose, I have also attached the two configurations i used for this test.
My Observations.
The debug text has two blocks of output seprated by "------------------" . The first block is the output when the Transcoding configuration is run and the second block is the output when the thumbnail configuration is run.
It is clear that at the Transcoding phase the thumbnail array is empty, which is ok
[field_mm_thumb_file] => Array
(
[0] =>
)
But at the thumbnail generation phase the transcoded file array is empty which is not desirable.
[field_mm_result_file] => Array
(
[0] =>
)
This is the reason why the transcoded file is not shown at the node view page. Can any one post a solution to this
Comment #13
mani.atico commentedsubscribing
Comment #14
zaczek commentedHi,
I think I might have found a solution: http://drupal.org/node/368956#comment-1935600
Could you please test it on your site? It worked for Szczym's site.
Cheers,
Jakub Gawlikowski
Comment #15
zaczek commentedThis issue is related with a change made in the CCK module: http://drupal.org/node/227677
The fix reverts to the default behaviour (not setting NULLs on fields that are not provided).
Jakub
Comment #16
zaczek commentedHere is a patch for this problem meant for the CCK module (content.module).
It is meant for CCK-6.x-2.5.
It only works on non-multiple fields (i.e. if the number of values for the destination filefield to be used is set to 1 in the field definition for your content type).
Please let me know if you encounter any issues. Maybe somebody knows if it's possible to fix it in the Media Mover module?
Cheers,
Jakub
Comment #17
szczym commentedI confirm, the patch solves the problem!
We still need permanent solution (and we dont know if it brakes any other functions cck module)
Comment #18
venkiparam commentedI have not applied the patch yet, But i believe that what Damien Tournoud says here http://drupal.org/node/227677#comment-1937658 is true. CCK is inserting NULL into the columns because we are passing NULL (see #12 debug.txt). We need to find a solution inside Media mover.
Comment #19
zaczek commentedOK, I have looked into this again and found a way to update the Media Mover API with no changes necessary in CCK.
The problem was related with the node_load function that can only load data from core tables. This was causing the Media_Mover module to update the record with NULL data it got trying to query the nodes.
The solution is was to use the content_node_load function written by alonpeer and described here: http://drupal.org/node/360541
This function is able to load the full node including CCK fields. I have added this function to the Media Mover API, as it might be useful in other situations.
So now, instead of using
node_load($nid);we are usingcontent_node_load(array('nid' => $nid));The new patch for media_mover_api.module is attached. It also handles the situation for multiple fields.
Cheers,
Jakub
Comment #20
zaczek commentedIn this patch version, I have made a small change to follow naming conventions and changed the function name to media_mover_content_node_load.
Comment #21
szczym commentednew patch works :))) I just tested it, could any one test it also ?
cheers !
Comment #22
venkiparam commentedConfirming, The new patch works for me , Thanks to zaczek
Comment #23
venkiparam commentedThe patch also works in the Dev version (Release Jul 19 2009).
Comment #24
zaczek commentedThanks, Venkiparam.
For everyone else, the patch in question is attached here.
Comment #25
bekasu commentedCorrected misspelling in title per szczym's request
Comment #26
szczym commentedIm not sure if its directly related but that issue have #532170: MM is encoding a file any time i run config arise right now. (don`t if it was before because its happening only with more than one configuration).
Comment #27
arthurf commentedThanks for finding this issue. Reviewing this patch, I see a few things:
* it has to conditionally load CCK-
if(module_exists('content') )if it goes into the media_mover_api module- otherwise it should live in mm_cck which depends on CCK anyway. I like the idea of having this as a core function in media_mover_api, but I'm not sure that there are any use cases beyond CCK? Not sure.* is there a need to rewrite all of this code an not just use cck's content_load($node) function instead? If we do something like:
Doesn't that give us all the same information and make the function less brittle?
I'd be happy to commit this, I just would like some feed back on the above first.
Comment #28
zaczek commentedHi Arthurf,
I have tested this code:
and it seems to work. It is cleaner for sure. You are probably right that there are no use cases beyond CCK, however I don't know how to integrate it with the mm_cck module.
Best,
Jakub
Comment #29
arthurf commentedThanks for testing. I committed this code to CVS last night, so I think we should be reading for testing. I did some additional refactoring to make the code cleaner. Would people mind testing this and I'll ready a new release if it passes? There are a bunch of bug fixes that would be nice to get out in the world since I've been slacking so much this summer.
Comment #30
szczym commentedarthurf its great to have you back in moving media space ! We have all ready developed patched mm, witch consisted of over 5 various patch as far as i remember ;)
I would test the cvs code strait on but here: http://drupal.org/project/cvs/106431 i can`t see any commits regarding to #486206: Files transcoded but not added to filefiled. Am i missing some thing ?
Comment #31
arthurf commentedHrm, maybe I attributed these to a different ticket- see:
http://drupal.org/cvs?commit=261334
http://drupal.org/cvs?commit=263064
So these fixes should be in the dev branch now...
Comment #32
szczym commentedi just tested on fresh drupal install with mm-dev from 2009-Sep-17:
the issue still exist, i have 3 mm configs, effect of one of them is not attached to cck filefiled with configs on auto run. when i make configs run manually by pressing one by one, its working ok.
the issue also exit when i swap mm_cck.module for old version patched against old "summer" version of mm-dev
Comment #33
arthurf commented@szczym are you saying that the configuration is not running on cron, or that the fix for the filefield issue does not work?
Comment #34
szczym commentedConfigs are running on node creation, file is encoded, after it its on hd and in the mm log BUT not in filefiled.
btw: i have 3 configs, 2 of them are running ok, one not makes into filefiled.
btw2: im on irc
Comment #35
arthurf commentedAre there any errors being reported by mm_cck in dblog?
Comment #36
szczym commentedno, all is normal, no errors. here is log entry from ffmpeg:
But output_1.flv did not landed in filefiled.
Comment #37
okeedoak commentedsubscribing
Comment #38
szczym commented@arthur: what is a problem to commit zaczek patch into dev version ? as far as i see, its not in cvs but its critical for normal usage of mm ...
Comment #39
arthurf commentedThe patch: http://drupal.org/files/issues/media_mover_api-nullupdate-0.3-dev.patch is in mm_cck. I don't want to use the function that is proposed as it is an attempt to duplicate content_load() which is a API function for cck- a much more stable way to do this. Can you test against 6.1.x and let me know if that is working for you?
Comment #40
brunodboI tested 6.x-dev and found that storing to filefield only works when there's no complete action (as reported in #8). Furthermore, when I display the file as 'Generic files' (set in CCK 'Display fields' settings), the link is constructed with a '?q=' in front, thus pointing to a non-existing location. When I change the Display field setting to 'URL to file', the correct URL is being displayed.
Comment #41
brunodboWhile transcoded files are added to the right filefield (given there's no complete action), they are not shown in the 'Media Mover files' section on node/edit (= the list where Media Mover files on that node should be displayed).
Comment #42
arthurf commented@brunodbo - can you confirm that this file is not in an error state? You can check by going to the admin -> build -> media_mover -> your configuration -> files
Comment #43
delykj commentedI tried the latest Media Mover dev version (2009. nov. 14.), with latest CCK, File Field modules and file field saving not works.
I also tried zaczek patch (http://drupal.org/node/486206#comment-1946978) but still not works.
Any idea how to save a successfully processed file into a file field?
Comment #44
brunodbo@arthurf: No, no error state. Thanks for following up.
Comment #45
delykj commentedI debugged the code and fixed the bug.
In the mm_cck_field_filefield function, please change
from:
to:
When I create a new node, and the filefield is empty, the first field in the array is null. So at the cron run when you add the newly created field to the field array, Drupal not saves the new field because of the first null value.
Comment #46
arthurf commented@delykj - I've committed a variation of your code suggestion. This issue was discussed on another issue- the original code used $node->{$field['field_name']}[0] which was changed to $node->{$field['field_name']}[] due to another bug report. Hopefully your suggestion fixes it in both instances.
Comment #47
delykj commentedarthurf, your modification not works for me.
$node->{$field['field_name']} is an array, so not need to check it (at least in my case). But the first element is null.
I modified your code a little bit:
Comment #48
venkiparam commentedThe problem as mentioned in #12 is still there. Tested against both the Latest Dev and 6.x-1.0-beta6 versions. This time the CCK field Arrays are getting populated properly but when node_save($node) is called. The CCK data is not getting saved.
Comment #49
rexsham commentedI confirm that I repeat the same problem with Latest Dev Jan-11 and 6.x-1.0-beta6 .
When first Media mover config is run, MM CCK worked ok, but when second runs, it always fail to write into the filefield, but the process is done correctly.
I transcode a flv, then make a thumbnail, both processes give correct files but only one of them can write to CCK filefield.
I have not patched anything and just used to latest release of all modules.
I'll try patching as above and reply here again.
Comment #50
rexsham commentedI applied the patch in #24 but it does not work for me too.
I used CCK 6.x-2.6 and 6.x-1.x-dev (2010-Jan-11)
Both Video and Thumbnail are transcoded and created, but only Video is put into filefield, Thumnail is not put into filefield.
Attached are the screenshots
Comment #51
arthurf commentedI added a modified version of #47 - can somebody who is having issues with this check out if this issue still exists?
Comment #52
rexsham commentedWhat modifications did you do arthurf?
I tested with 27th Jan Dev and problem still exists.
I changed the code stated in #47 but problem is still there.
Only video transcoded and put into filefield, thumbnail is created but not put into filefield.
Comment #53
arthurf commentedSee: http://drupalcode.org/viewvc/drupal/contributions/modules/media_mover/co...
Comment #54
rexsham commentedProblem is still there even i added your modificationin #53
Have a look at the screenshot
Comment #55
rexsham commentedAnyone got success in using this module (updating 2 CCK filefield) ?
Please post your CCK version and media mover version.
I am desperate in this
Comment #56
thomas4019 commentedI seem to be having this problem. Only one of the configurations outputs is being put in the filefield.
Here's the version I am using. 6.x-1.x-dev (2010-Feb-14)
Is there a patch I can apply to fix this? Or should i revert to an earlier version. I have attached exported forms of both of my configurations.
There are no errors in the drupal log.
Thanks,
Comment #57
bryanb229 commentedAnyone made any progress with this?
Comment #58
thomas4019 commentedI was able to get three configurations to save transcoded videos to different FileFields in the same node when cron runs. I am using Media Mover 6.x-1.x-dev (2010-Feb-17) but i would expect the latest version to work as well. I did not have to apply any patches but i don't remember if I did anything else special to make it work.
Comment #59
rexsham commentedwhat version of CCK are you using?
Is it a fresh installation or what?
Comment #60
thomas4019 commentedI am using
Drupal 6.15
FFmpeg Wrapper 6.x-1.1-beta1
Content Construction Kit (CCK) 6.x-2.6
FileField 6.x-3.2
Media Mover 6.x-1.x-dev (2010-Feb-17)
SWF Tools 6.x-2.5
What is your problem exactly? I am not actually using Media Mover to create transcode to FLV anymore. I am currently using Media Mover to transcode to MP4 and MPEG and am using FlashVideo (http://drupal.org/project/flashvideo) for creating the FLV files. Even if you get Media Mover to transcode to FLV, you likely will need to fix the flvs using a program like flvtool2 to make them stream well. FlashVideo will do this all for you and I have been very pleased.
Comment #61
hatsch commentedi have the same problem here. i have three configs with custom commands.
one configuration is run on node update
the other two configs run on cron. all configs show the status finished. all files are created. but one file (from the last run configuration) is not attached to cck filefield.
i am using:
Drupal 6.16
Content Construction Kit (CCK) 6.x-2.6
Media Mover 6.x-1.x-dev
FileField 6.x-3.2
Media Mover Custom Command 6.x-1.0
when i manually set the status of file that was not attached to Harvested and re-run the configuration, an error occures
and the file stops in the Processed State
i am also using filefield_paths. to assure this is not related to filefield_paths i disabled it, but i still have the same issue...
Comment #62
hatsch commentedit looks like version 6.x-1.0-beta7 eliminated the problem! at least for me
all three configs i have run now smooth on cron!
thank you!
Comment #63
arthurf commentedAwesome. Marking this as closed unless anybody else has issues.