This line (flashvideo.module line 1336) apparently affects all uploaded files:

$tempfile->filepath = str_replace($path .'/', '', $tempfile->filepath);

If you have set your $path ("Video Import Directory" in the FlashVideo FFMPEG settings in the admin) expecting your video files to get placed in the files/ root, you're mistaken. What happens is the concatenation ($path . '/') returns simply '/' and ALL uploaded files are then renamed something on the order of this:

sitesdefaultfilesimagesMyPictureName.jpg
sitesdefaultfilesgarland_logo.gif
etc.

This is a disaster. FlashVideo just destroyed all my galleries on my development server! Why is it even affecting non-video files? At least make it so that you can't set the Video Import Directory to "".

CommentFileSizeAuthor
destroyed-files.png35.53 KBtransio

Comments

attheshow’s picture

Status: Active » Postponed (maintainer needs more info)

I've never heard of such a thing ever happening to any users of this module. Can you detail the steps we would take to duplicate this issue?

attheshow’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No response from original poster. Closing issue.

james marks’s picture

Status: Closed (fixed) » Active

Actually, this just happened to me as well, and not just the files in my directory but in all subdirectories as well.
It renamed them, concatenating the directory, subdirectory/ies and filename, moved them out of the files subdirectories into the files directory, and then created a node for each one of them in the content type that I had set up for FlashVideo. When I filtered the content list by the content type, the list went on for at least 10 pages.

If this hadn't happened on a dev server backed up by subversion, I'd be in deep doo doo.

I'm working on recreating the problem now and will report my findings.

james marks’s picture

It looks like it

  • took everything from sites/[domain_name]/files/*
  • renamed it "sites[domain_name][subdirectory][filename]
  • moved it into sites/[domain_name]/files/

So I had

  • sites/[domain_name]/files/sites[domain_name][subdirectory][filename1]
  • sites/[domain_name]/files/sites[domain_name][subdirectory][filename2]
  • sites/[domain_name]/files/sites[domain_name][subdirectory][filename3]
  • etc...
james marks’s picture

Version: 6.x-1.5-rc2 » 6.x-1.5-beta2

I run multiple domains under the same Drupal installation so files are stored in: [drupal]/sites/[domain_name]/files/

Here are the steps I took to reproduce the problem:

  1. Create a new content type ("flashvideo_test")
  2. Configure FlashVideo for new content type:
  • Check the "Enable the FlashVideo for all nodes of this type: flashvideo_test" in FlashVideo Settings
  • Check "Convert video immediately"
  • Delete value in "Video Import Directory" ("flashvideo_test_import") leaving it blank*
  • Set FFMPEG Settings:
    • Set "Original Directory" to "flashvideo/original_video"
    • Set "Output Directory" to "flashvideo/converted_video"
  • Save configuration
  • Create subdirectories for flashvideo files:
    • [drupal]/sites/[domain_name]/files/flashvideo
    • [drupal]/sites/[domain_name]/files/flashvideo/original_video
    • [drupal]/sites/[domain_name]/files/flashvideo/converted_video
  • Create new FlashVideo Test content
  • Attach video file using "Video Upload" field
  • Save content
  • Every file in files directory and subdirectories is renamed, concatenating the filepath and filename, and moved to files directory as:

    • sites[domain_name]files[subdirectory][filename1]
    • sites[domain_name]files[subdirectory][filename2]
    • sites[domain_name]files[subdirectory][filename3]
    • etc...

    and a new node is created for each file so renamed and moved.

    *I'm guessing the problem is caused by my leaving the "Video Import Directory" field blank which is obviously an error on my part, made while trying various settings while trying to get FlashVideo to work, but I had no idea that leaving this field blank would have such disasterious consequences on files in subdirectories.

    Setting the "Video Import Directory" field to "flashvideo" then reuploading and resaving video appears to solve the problem, resulting in

    • my "player.swf" file being moved from the "flashvideo" subdirectory into the "files" directory
    • converted video and thumbnail being moved into the "flashvideo/converted_video" directory
    • original video apparently deleted (not moved into the "flashvideo/original_video" directory)
    • no other files being renamed or moved

    However, it's still a pretty disasterous and somewhat unexpected problem to deal with given that it processes not only all the files in the files directory but all the files in all the subdirectories of the files directory as well. (Literally hundreds of files were renamed and moved.)

    james marks’s picture

    Version: 6.x-1.5-beta2 » 6.x-1.5-rc2
    james marks’s picture

    Title: Using empty "Video Import Directory" setting destroys naming of all uploaded files » Using empty "Video Import Directory" setting renames and moves all files in files directory and its subdirectories
    Version: 6.x-1.5-beta2 » 6.x-1.5-rc2
    james marks’s picture

    Related bug report: "Error on cron run - filesize(): stat failed" http://drupal.org/node/449456

    travist’s picture

    Status: Active » Fixed

    Mark,

    I just fixed this issue and checked it in. I also took care of a major issue if the Output directory is the same as the Import directory (which would cause recursive file copying madness).

    Thanks,

    Travis.

    Status: Fixed » Closed (fixed)

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