MM is encoding a file any time i run config

szczym - July 27, 2009 - 14:00
Project:Media Mover
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I have MM 2 configurations:

1 encode video from uploaded files into flv and store in cck filefield.
2 generate thumbnail out of video from uploaded files and store in cck imagefield.

Any time i run a config, MM is encoding files and generating new ones. It should encode one time and remember it was all ready encoded.

AttachmentSize
zrzut_ekranu.png234.48 KB

#1

szczym - September 8, 2009 - 17:15

BTW: Its not running again first configuration (harvest) only the following ones.

#2

szczym - September 8, 2009 - 17:19

it migh be some how related to this issue: #342583: Problem with CCK harvesting

#3

venkiparam - September 10, 2009 - 05:57

I had the same issue. The problem is with the mm_cck submodule. I was able to create a patch which solved this issue.

There are two major fixes in it.

1. It fixes the case where files are picked up multiple times (Though little dirty fix, but wanted to fix this with minimal change to the original code)
2. It fixes the case where, if you delete a configurations files and rerun the configuration. The new file will not get properly attached to the cck fields (Don know how to put it clearly, but try deleting a configs file and rerun the config, you will get the point)

apart from this there are few debug statements which you can ignore.

Thanks szczym for testing the patch.

AttachmentSize
mm_cck.module.patch 2.38 KB

#4

szczym - September 10, 2009 - 08:00
Status:active» reviewed & tested by the community

Indeed it works and solves the problem! well done venkiparam!

#5

arthurf - September 10, 2009 - 14:16

This patch looks good. I'll remove the commented out watchdog calls and apply it. Thanks for your work on this- I've been swamped this summer and haven't had much time to devote to things.

#6

arthurf - September 10, 2009 - 19:37
Status:reviewed & tested by the community» needs review

I've committed this to the 6-1x branch. I also did some whitespace cleanup. I have one question about the patch- line 509 changes:

$node->{$field['field_name']}[] =

$node->{$field['field_name']}[0] =

It strikes me that if there is data on the first item on that field it will be destroyed - or am I missing something here? At any rate, in the hopes that I'm wrong, I committed it.

#7

venkiparam - September 12, 2009 - 04:14

Thanks szczym.

arthurf
Let me put the motive behind the change and then lets see if its really is required, I will need your help arthurf.

Consider this case.

1. You run your configuration which stores a file to the cck filefield.
2. You think that the configuration needs to be rerun(for some reason) only on a specific node.
3. You go and delete the files associated with the configuration.
4. Rerun the configuration, so that the new file gets stored to cck.

The issue lies in step 3 & 4.
-When you delete files associated with the configuration the cck filefield is not cleared.
-As a result when you rerun the configuration old file still exists at index '0' of this array $node->{$field['field_name']}[] and the new files goes into index location '1'. Due to this when cck stores the files, only the file at index '0' gets saved(Which is the old file) and the file at index '1' (Which is the new one) is ignored.

Meaning any time you rerun a configuration for a node the old files are not overwritten. I opted to fix the issue is step 4, but this can as well be fixed in step 3. What say ?

venkiparam

#8

szczym - September 14, 2009 - 17:48

Arthur thanx for your time!

Could you have a look on another important patch, that we have developed together with zaczek and venkiparam:
#486206: Files transcoded but not added to filefiled

Sorry for posting in wrong place, i have send you mail about that also few days ago.

cheers !

#9

arthurf - September 15, 2009 - 02:08

venkiparam- Thanks for the detailed report. I think I'd like to fix the delete issue as that should work anyway :)

The question I think is that we should make sure that we can delete files attached to a node that were placed there by the MM Configuration. I think I can handle this by looking at the data in the MM Files table. I'll make a comment here once I have some code put together.

#10

arthurf - September 15, 2009 - 04:10

Some notes
* I've moved the CCK file delete issue to: http://drupal.org/node/577650
* In the latest commit, I've implemented $node->{$field['field_name']}[]

It would be great to get some testing against 6.1x - these fixes are hopefully going to fix some of this!

#11

szczym - September 17, 2009 - 02:47
Status:needs review» reviewed & tested by the community

I just tested newest dev version (2009-Sep-17) on fresh drupal install. the issue is solved, configs dont run every time i press run

;)

#12

arthurf - September 17, 2009 - 03:09

Awesome!

#13

arthurf - November 17, 2009 - 20:52
Status:reviewed & tested by the community» closed

closed

 
 

Drupal is a registered trademark of Dries Buytaert.