So I noticed that flashvideo_convert is passing token_replace the $account variable...

This works fine if 'Convert video immediately' is set, but if video conversions are happening on cron, $account is going to be whoever initiated the cron (usually Anonymous?)

We also have the uid of the owner of the file available in this context though, and chances are pretty good that the initial token_replace call used their account, so how about we pass that account into token_replace instead?

Here's a patch to that effect:

CommentFileSizeAuthor
flashvideo-use_owner_tokens-1.patch906 bytesVector-

Comments

Vector-’s picture

Category: support » feature
Vector-’s picture

Title: Fledgling support for user directories without 'Convert video immediately' (w/ filefield) » Proper token generation for FileField paths without 'Convert video immediately'
Category: feature » bug
Priority: Normal » Minor

Renaming / reclassifying this issue to be more appropriate...

This feels like a bug to me, we know the owner, we give them ownership of the thumb and converted video, we should generate tokens accordingly.

Incidentally, this allows the sorting of uploaded videos into user directories...

Follow-up work on flashvideo_import and FileField paths may be found here:
#812562: Making flashvideo_import respect FileField path settings for original video

trungonly’s picture

Version: 6.x-1.x-dev » 6.x-1.5
Priority: Minor » Normal

Same problem for me. The variable $account was never defined. So it uses token for current cron user, this is not corrrect.

Vector's patch is good this case.

Please fix this bug, thanks.