Closed (fixed)
Project:
Remote File Source
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 May 2012 at 23:33 UTC
Updated:
28 Nov 2012 at 13:17 UTC
This doesn't seem to be working for me,
Here's what I've done. Created a file content type. Under file sources I have two options, Remote File and Remote URL Text Field. I'm not sure what one was enabled by this module. The first option lets me select a remote file but it still transfers to file locally to the filesystem. The 2nd option is stranger. When I use that I can type in a remote url but the upload button says "transfer" and returns some ajax error without doing anything. Neither seem to be right because I don't want to transfer the files locally.
Am I doing something wrong? What file source should I be selecting?
Comments
Comment #1
timefor commentedI think I found the issue, when I upgraded to the latest dev release and uninstalled File Field Paths module this worked as expected using "Remote File" as the source. The File Fields Path module may be a conflict.
Comment #2
webadpro commentedThe submit button shouldn't say "Transfer" but "Select".
Although in the field options, make sure you check: 'Remote File'. Although if you think you have found a bug, ill look it up. A patch is always welcome too.
Comment #3
webadpro commentedComment #4
burningdog commentedI can confirm this issue with filefield_paths module - if it's enabled, then on node save it moves the uploaded file to a new (local) location defined by a replacement pattern, and if no replacement pattern is defined it simply moves it to
public://filename.jpgThis because of the following line in function filefield_paths_filefield_paths_process_file()
The file_move attempts to move the existing file to a new location (defined by $file['uri']), which is local, which defeats the point of Remote File Source. I've looked through Filefield Paths and there doesn't seem to be a way to stop the call to filefield_paths_filefield_paths_process_file() - which is where the file_move happens.
The simplest idea seems to be to add an additional checkbox to the Filefield Path settings called "Skip processing the file", check it, and then add a check for that here:
This code works, to keep the file remote, not local.
I tried playing with hook_module_implements_alter() to unset the value of "filefield_paths" when filefield_paths called
<?php foreach (module_implements('filefield_paths_process_file') as $module) {?>but turns out that hook only allows changing the weight value, not stopping a call to an undesired function.So, looks like we need a patch to filefield_paths, as I can't figure out how to override the filefield_paths behaviour from Remote File Source. Unless there's another suggestion?
Comment #5
burningdog commentedI've proposed a patch at #1361884: Remotes files should not be processed which fixes this issue. Turns out other people using remote files (like youtube or vimeo urls) are having the same issue, so it makes sense to patch Filefield Paths to not process *any* remote files.
Comment #6
webadpro commentedI dont think we can do much within Remote File Source. This is a File field Paths issue.