Everytime I ran cron on a site that had tokens for file path that used user information it defaulted to the temp directory. To deal with that, I switched the $destination_path to the input files path.

CommentFileSizeAuthor
#6 patch.txt11.17 KBsndev
#3 patch.txt49.38 KBsndev
patch.txt767 bytessndev

Comments

zoo33’s picture

Status: Needs review » Needs work

From what I can tell, the str_replace() in the patch will never actually replace anything, so that line could just as well be written as:

$destination_path = $node->{$field_name}[$field_instance]['filename']

Also, I'm not sure how $node->{$field_name}[$field_instance]['filename'] could work as a destination path for this file, as it is a new file being created, not an existing one being overwritten.

Please explain.

I can see that here might be a problem with file path tokens not being expanded. There might be some hooks that this module fails to invoke before saving new files. If someone wants to investigate this they are more than welcome!

sndev’s picture

$node->{$field_name}[$field_instance]['filename'] has to do with the original file (input file). I used that information along with the filepath info to get the original files location. Rather then trying to reuse the path tokens set for the file field, which would default to no user since apache is running the conversion during cron.

sndev’s picture

StatusFileSize
new49.38 KB

oops trying to post to a different issue.

zoo33’s picture

Status: Needs work » Reviewed & tested by the community

First, I see you point about the file path in the first patch. (I misread the patch before.) This is probably a good change.

The second patch is harder to overview. It seems to deal with a lot of different things at the same time. I would prefer separate issues for each problem/task:

1) Whitespace/coding style changes.

2) Hm, isn't there already a different issue for this:

-  // TODO: Add option to hide original files.
+  $form['field'][$form_item_id]['hide_original'] = array(
+    '#type' => 'radios',
+    '#options' => array(t('Show All'), t('Hide Original')),
+    '#title' => t('Display'),
+    '#weight' => 10,
+    '#default_value' => $default_field_setting['hide_original'], 
+  );

Also, I think a #description would probably be useful.

3) The changes in ffmpeg_converter_nodeapi() – are these only related to 4)?

4) The split of the conversion and snapshot generation jobs is a good idea, and I really appreciate your efforts on this. I just find the patch a little hard to follow right now, for the reasons mentioned above.

To sum up, let's consider the first patch RTBC, and then create separate issues for 1) through 4), OK?

sndev’s picture

1) http://drupal.org/node/608862

2) You are right I'll adjust patch as necessary.

3 and 4 are related.

I'll create a new patch against HEAD and we can go from there.

sndev’s picture

StatusFileSize
new11.17 KB

This patch is NOT for this. I am sorry, I'll add this to the different issue.

zoo33’s picture

Status: Reviewed & tested by the community » Fixed

Committed the patch in the original post, with the addition of a modified code comment. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.