Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After activating "File (Field) Paths" and saving the settings for a (file|image) field, the settings "file_directory" is set to the value entered in the ffp-settings ("file_path").
Modules, relying on "file_directory" (e.g. "Media") therefore fail to upload the files into the correct directories.
Any suggestions on how to fix this? At the moment I undo $form['instance']['settings']['file_directory']['#access'] = FALSE;
(filefield_paths.module L26) in a custom module to allow entering the directory.
Comments
Comment #1
ericclaeren CreditAttribution: ericclaeren commentedHi, I have the same problem, when using file with the media module (media selector widget), the file(field)path directory is completely ignored. Could you explain what exactly goes wrong, cause I don't get it.
Comment #2
hepabolu CreditAttribution: hepabolu commentedAfter much time debugging (with my limited knowledge of PHP and Drupal inner workings) I noticed that the Feeds module also has this problem, because it calls file_field_widget_uri somewhere along the line.
I think a better approach would be if filefield_paths intercepts the file_field_widget_uri function and provides a version that takes the different file path location into account.
I'm sorry I'm unable to write such a module.
Comment #3
dgtlmoon CreditAttribution: dgtlmoon commentedSure you're not being stung by #1854450: Support for Media ?
Comment #4
Deciphered CreditAttribution: Deciphered commentedMarking this as a duplicate of #1572206: Is it possible to disable FFP for a certain field?, not because it's the same issue, but because the solution in that issue should resolve this issue (allow you to disable File (Field) Paths on a Media field and set 'file_directory').