In my case, this is exactly: I'm using media_youtube in a field. In this, I've enabled upload image, or embed youtube video. When upload a youtube video, the file display completely broken, because of moving files.
These should be solutions:
1. Only process file, it has own extension.
It works with embed video in my case, but the question is: Uploaded files without extension always need to skip ffp process?
2. Add field to ffp administration, where user can edit the exceptions of ffp process, eg can set some file filemime.
3. Other modules what provides this type if files need to use hook_filefield_paths_process_file() to set $file['new'] always false.
Comment | File | Size | Author |
---|---|---|---|
#11 | filefield_paths-skip_non_local_files-1361884-11.patch | 1.3 KB | burningdog |
#10 | filefield_paths-skip_non_local_files-1361884-10.patch | 1.04 KB | burningdog |
#9 | filefield_paths-skip_processing-1361884-9.patch | 1.55 KB | burningdog |
#1 | skip_video_1361884_1.patch | 743 bytes | szantog |
Comments
Comment #1
szantog CreditAttribution: szantog commentedAnd a patch for option 1.
Comment #2
Dave ReidProbably the module shouldn't process any remote files. The file_entity module provides a file_entity_file_is_local() whose code could be re-used for this purpose.
Comment #3
jacobpov CreditAttribution: jacobpov commentedbecause of this it broke my embed field none of the new nodes worked. instread of processing the URL right it made some file and renamed it instead of outputting the video itself. there has to be some disable button for a specific field to save from those problems.
I haven't tested the uploaded patch but it sounds like not the best solution , perhaps disable button for a field would be better?
Comment #4
jacobpov CreditAttribution: jacobpov commentedok patch can no longer be applied to the news versions .... I will disable file field paths for now .
Comment #5
szantog CreditAttribution: szantog commentedYes, you are right. But since then a lot of things happened.
Comment #6
jacobpov CreditAttribution: jacobpov commentedyeah but its something different .. I was looking to use this module not other that works with enteties
Comment #7
bkat CreditAttribution: bkat commentedI'm having the same issue and I've hacked around it by bailing out of filefield_paths_filefield_paths_process_file() if the file's uri starts with "youtube://". Obviously not a real solution but it has gotten me past the problem for my site.
Comment #8
burningdog CreditAttribution: burningdog commentedI have a similar issue. I'm using Remote File Source to allow a file entity to be a full url, like http://www.example.com/path/to/remote/file.jpg
This works fine, until Filefield Paths is enabled - then the file is copied locally and the uri changes to something like public://file.jpg (if no replacement pattern is defined the file is still copied locally).
Like the posters above, I need some way to either:
* NOT call filefield_paths_filefield_paths_process_file()
* exit filefield_paths_filefield_paths_process_file() on certain conditions.
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. I don't know if there is a way to stop module_implements from returning "filefield_paths".The simplest idea seems to be to add an additional checkbox to the Filefield Path settings for a particular field called "Skip processing the file", check it, and then add a check for that here:
This works, but I'm not sure if it's the most elegant solution. Patch coming.
Comment #9
burningdog CreditAttribution: burningdog commentedPatch attached.
Comment #10
burningdog CreditAttribution: burningdog commentedHere's a better solution, proposed by Dave Reid in #2, i.e. don't process any non-local files. This introduces a dependency on file_entity because of the call to
file_entity_file_is_local()
.Comment #11
burningdog CreditAttribution: burningdog commentedfile_entity_file_is_local()
is just 3 lines of code - is it really worth introducing a dependency for those 3 lines? Rather, let's copy that function into filefield_paths and use it instead:filefield_paths_uri_is_local()
Comment #12
burningdog CreditAttribution: burningdog commentedTitle change.
Comment #13
jaydub CreditAttribution: jaydub commentedHappy I found this ticket. This is exactly what I was looking for. Applied patch and remote URLs are not being hit now.
Comment #14
ju.ri CreditAttribution: ju.ri commentedAny chance for a D6 patch? Thanks!!
Comment #15
Deciphered CreditAttribution: Deciphered commentedThis seems like flawed logic to me, break means it will stop the foreach loop, which means if there happens to be any files after this file that are local they will never be processed.
Happy to make the changes myself and give you credit in the changelog and commit message, or let you fix the patch and get the commit attribution.
Cheers,
Deciphered.
Comment #16
dwkitchen CreditAttribution: dwkitchen commentedThe patch did what I needed as my site doesn't mix local and remote files in the same field.
Agreed it should be something like:
Comment #17
Deciphered CreditAttribution: Deciphered commentedFixed and committed.
Thanks all.
Comment #18.0
(not verified) CreditAttribution: commented.