Awesome module until a couple of months ago. I have only noticed this as I was going through some of the folders in the files folder. It seems that no tokens are pulling through. If I un-tick the "Enable File (Field) Paths?" the folder/token works. When I use the field paths the tokens are not used and the default is used, basically as it was un-ticked.

Is anyone else experiencing this?

Field collection 7.x-1.0-beta5+1-dev (2013-Apr-12)
Field group 7.x-1.1+67-dev (2013-May-16)
File (Field) Paths 7.x-1.0-beta4

Comments

quazardous’s picture

same here with last dev

no sorry it was a directory right issue !

glynster’s picture

As an update this is still an issue however through our module we are using a private folder system. Not that I think this makes any difference as this was working before.

dww’s picture

FYI: I noticed what I thought was similar behavior on a test site, but it turned out the problem was that the user httpd was running as couldn't unlink files in the configured files dir. So even though files were getting copied into the new places, the original files weren't getting unlinked and I guess therefore the DB wasn't getting updated to point to the right directories. Once I restarted my experiment with a files dir that the httpd user could write to, it all works as expected. Perhaps you're having a permission problem of some kind on your site?

glynster’s picture

Are you using a generated private folder? We have one generated by a custom module. The funny thing is this was working up until a couple of months ago. I assume since a module was updated or perhaps Apache updates. The paths modules works as expected on public folders. However this one is a private one...

dww’s picture

Yeah, all these files are public on my site. *shrug*

Good luck,
-Derek

skt’s picture

I've seen this issue as well.

Thanks to https://drupal.org/node/1819234, I was able to find the cause of this particularly baffling problem. I'm using:

Filefield Sources 7.x-1.8
File (Field) Paths 7.x-1.0-beta4
Field Collection 7.x-1.0-beta5 (though the image fields weren't in field collections)
IMCE 7.x-1.7 (for file browsing)

In my case I was not using tokens, just a path to a directory within my public folder. The path set in File (Field) Paths is ignored in favor of what's set for the regular image upload field, which is hidden once File (Field) Paths is enabled. If no path was set in the regular image upload field, IMCE file browser would simply show the root level of my public files directory, denying access to the subdirectories.

This was only a problem for the "File browser" and "Reference existing" options offered by Filefield Sources. Uploaded images were nevertheless stored in the directory specified in File (Field) Paths.

Once File (Field) Paths was disabled, the regular image upload field reappeared and could be set. When I re-enabled File (Field) Paths, I found no need to set a path in File (Field) Paths -- the uploader and browser both refer to the directory set in the regular image upload field.

**EDIT:
I'm not sure how I missed this before, but in the field settings (right under the File (Field) Paths group), there's a checkbox asking "Enable File (Field) Paths?". Unchecking this reveals the regular image upload path.

glynster’s picture

I am glad we are seeing more progress on this one. My case still exists no matter what I do.

However none of the above are using my setup:
- Field collection 7.x-1.0-beta5+1-dev (2013-Apr-12)
- Field group 7.x-1.1+67-dev (2013-May-16)
- File (Field) Paths 7.x-1.0-beta4

Plus I am using a private directory. If I have something in the drupal default path or not and use filefield it makes no different the file is still dumped in the root of the files folder.

Deciphered’s picture

Priority: Critical » Normal

Can someone who is experiencing this issue please provide reproduction steps on how to see this issue when installing File (Field) Paths in a fresh install of Drupal 7?

Preferably use the latest dev release of File (Field) Paths, and only use other contrib modules that actually ensure that this issue can be reproduced (ie, don't install Field group if it doesn't need to be installed to see the issue).

I obviously want to fix this issue, but I can't do so until I can see the issue.

Alternatively, if you can give me access to a site where I can see this issue, obviously I'd need some sort of filesystem access, and this is usually something people don't wish to give out :)

Cheers,
Deciphered.

P.S., I downgraded this issue from critical as it only appears two people are currently experiencing this issue and it's not breaking your site, it's just leaving the filesystem slightly unsorted.

Renee S’s picture

edit: ooops. Wrong issue. Sorry, folks.

scottsawyer’s picture

FYI, not trying to hijack this issue, I did experience this and other unexpected behavior. I was able to work around it, so I wanted to share in case it helps someone else.

I am building a migration, my images are all in the default/files directory. When I run the migration and create the new nodes, I want to move the images into default/files/[uid]/[content-type/[nid]. I have a File Field Path on my content type [node:author:uid/photos/[node:nid], but I later discovered I had made a typo in my token, so it was [node:author:id]. This was causing many problems, and threw me off.

Once I discovered that problem, flushed cache, I could upload images from the node/add screen and they would go to the correct directory, but my migration was putting the images in the correct directory, but was attempting to render from [node:author:uid]/photos/[node:nid]/./ <- this is an errant "./"

As it turns out, I had a field display setting for Flexslider. When I disabled Flexslider just on that field, the images uploaded to the correct location. Once the migration is complete, I can turn on the Flexslider field and everything works.

So, for troubleshooting purposed, double check your tokens, disable any special formatters or display settings, create a new field and see if that works.

Hope this helps someone.

glynster’s picture

I was the one who created the case so I wanted to get back to you with as much info as possible.

As this happened on a production site we ended up reverting to the Drupal standard file directory paths.

Anyhow from my tests it would seem when using the Public file system the Filefields work perfectly well. My issue was due to the Private file system. Our dev team created a specific directory for our needs back in Dec 2012. Back then it worked and worked well. Around March 2013 after an upgrade of Filefield the files uploaded were going into the private:root (specified directory ignored) or if we had a folder set in the Drupal default (even though it should be overridden by Filefield) files were placed there. I am fully aware of the On Save the files are moved, however our experience is that the files remained in the same place. Files are arriving in the Private folder.

So the test to reproduce would be for the Private file system only. Public works well and we have used this in a number of different projects.

SharonD214@aol.com’s picture

I'm trying to upload my files into a public directory but no matter what I add as the file (field) path settings im my image field the images always end up directly in the default files folder. Any ideas?

SharonD214@aol.com’s picture

Ok, I'm good now, the field path just didn't like the token I was using :(

BeWhy’s picture

Priority: Normal » Critical

I am also experiencing this. Bumping back to critical.

drupal-7.23
filefield_paths-7-1.0-beta4

created a new content type
added field "image"
unchecked 'enable filefield paths'
added path: images/photos
save
added field "images"
checked 'enable filefield paths'
added path: images/[node:content-type]/images
added filename; [node:nid]-[file:ffp-name-only-original].[file:ffp-extension-original]
save

created new node
uploaded field to image
result: file goes into correct path,
uploaded field to images
result: file goes into /sites/default/files/[original filename]

neRok’s picture

Title: FIle Field Paths not overriding Drupal Defaults » FFP not working with a (custom) private file system
Priority: Critical » Normal
Issue summary: View changes
Status: Active » Closed (cannot reproduce)

#11, I setup a private file system using Drupals default implementation, and setup FFP for a private image field. Upon uploading the image, it was added to the private directory. Upon saving the node, the file was renamed and moved to the correct folder as specified in FFP settings. I cannot find a problem. Perhaps your problem is related to the module creating your private file system referred to in #2? Maybe a module order error too?

#14, you have missed a step on the end, which is save the node. Once the node is saved, and the tokens are available/known, FFP then moves the file to the correct folder.