I have an image file where I use this module when I upload files. However, sometimes I don't want to upload a new image, but simply use one that is already uploaded to the site. So then it is good to be able to use the Media File Selector widget, that comes with Media module, but when I upload using this module, the file field path doesn't work.

Comments

drurian’s picture

Same here. It doesn't work with media module.

MXT’s picture

Issue summary: View changes

Here's an alternative that works with media module:

https://drupal.org/project/fe_paths

neRok’s picture

Title: Make file path work with media file selector » Add compatibility with Media module and its file selector function

Closed #2147339: Not working correctly with latest Media dev as duplicate of this issue.

I haven't tested anything, but the aforementioned issue talked about filefield_paths implementation of hook_filefield_paths_process_file. This code is configured to work with Drupal core, hence the line

if (filefield_paths_uri_is_local($file['uri']) && ($file['timestamp'] == REQUEST_TIME || $settings['active_updating'])) {

Media is different to core, as you are choosing files that are already uploaded, and in that case the image won't fall-into the above code. Media (or a third module on its behalf) may have to implement hook_filefield_paths_process_file to get this to work.

This is just a brain storm, but I believe it is on the right track. Or, use the fe_paths module if it works.

jstoller’s picture

I have a file field, using the Media file selector widget, on a field collection, on a node. I've set a file path and file name for the file field, but when I upload an image both are ignored. I'm using:

  • Drupal 7.26
  • File (Field) Paths 7.x-1.0-beta4
  • Token 7.x-1.5
  • Media 7.x-2.0-alpha3
  • Field collection 7.x-1.0-beta6+4-dev
erwangel’s picture

Yes it would be nice to have compatibility with media module. Same here, File (Field) Paths settings appear inside Media module settings but are ignored (using File (Field) Paths version 7.x-1.0-beta4). But, but, but....
... before closing/saving this comment, I tried the option "retroactive update", and that worked! My pictures were moved to the directory I had defined with File Field Paths as expected.

SocialNicheGuru’s picture

Deciphered’s picture

Status: Active » Closed (duplicate)

Yes, it is.