I was using a company name cck text field as part of my file name and despite having transliteration turned on the code never checked for the / character. This was causing problems as it ended up created a sub folder it never should have and then trying to write to a sub folder of that which didn't exist. As a short term solution on line 750 (filefield_paths_file_move) I added this line of code:

$file['filename']['new'] = str_replace('/', '-', $file['filename']['new']);

I didn't bother making it a patch file because I'm not sure this is the best way to fix the problem as I don't know the code well enough but it at least works now :)

Comments

sgabe’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev

I just encountered the same problem but with 6.x-1.4. The module doesn't remove the slash from the the [#termpath] where the term looks like "Blabla / blaba". So it builds a directory structure like sites/default/files/blabla_/_blabla/blabla.jpg. Any advice would be appreciated.

bensquare’s picture

Did you try to add the code as stated by Daemon_Byte ? cos it solves exactly the problem u mentioned

Also, I want to say thx you to the person who makes this module. The files & pictures are finally in good order based on nid instead of all going to one directory.

Ben

dunx’s picture

The above fix is specifically for filename, not filepath and won't work in that circumstance.

The issue is with pathauto, not filefield_paths.

The reason pathauto doesn't do what you expect it to do is because the string for termpath-raw could be something like "Event/Ski/Snowboard Event", where the term is "Ski/Snowboard Event". You want the path to be something like "event/skisnowboard-event", but the pathauto_clean_token_values doesn't know where to start converting the "/", so at the moment it just skips doing anything to termpath-raw and leaves it as is.

filefield_paths itself converts it to lower case though, so you'll get "event/ski/snowboard event".

My recommendation is to use just [term-raw], which will give you "skisnowboard-event" at least.

Or perhaps [term-raw][term-id] if you have multiple terms of the same name that sit in different parts of the taxonomy tree.

Deciphered’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

No longer supporting Drupal 6 issues for this module.