Hi,

since some time the file name replacement function of the upload file field does not work anymore. if i upload a pdf file to my own content type i will get the original file name instead of the replacement and will have to save the content, open it again and then the file name will *automatically* change without any interaction. if i save the content/note then for the second time without changing anything it will work. if i do not edit the content again the wrong/original name will not be replaced. any ideas?

thanks!

Comments

nplus1’s picture

Title: File name replacement pattern does not work anymore (CCK + FileField Paths) but after second saving » File name replacement pattern does not work anymore (CCK + FileField) but after second saving
Version: 6.x-2.6 » 6.x-2.7
karens’s picture

Project: Content Construction Kit (CCK) » FileField
Version: 6.x-2.7 » 6.x-3.x-dev
Component: fieldgroup.module » Code

Problems with files belong on the fieldfield issue queue, assuming you are using filefield.

nplus1’s picture

okay, any ideas how to solve these problems?

quicksketch’s picture

Project: FileField » File (Field) Paths
Version: 6.x-3.x-dev » 6.x-1.4

FileField does not include a feature to rename files based on a pattern (though it does have token replacement for directories). This is probably a question for FileField Paths.

nplus1’s picture

ok, sorry for the confusion. to make this clear: I am talking about the "File name: " setting in the "FileField Path settings" box of the "Manage Fields" tab of the content types admin page. Setting a replacement pattern there stopped working. I need to save the node, edit it, and without any modification save it again to get the right file name. the file name replacement seems to work but this information does not make it back to the node before saving it. if you click on edit afterwards the settings will be okay, you just need to save it again...

alison’s picture

Having this problem too, drives me nuts, plus regular users who don't know what's happening try clicking on the link to the file and think they didn't upload it right so they upload it a second time and then there's a million duplicate files and it's just a whole mess... (not to mention the time involved with doing everything twice, even if you're just saving it twice)

I think this is the same as http://drupal.org/node/635854 but I'm not one to mark things as duplicate.

Also, I think this may be related to/similar to the temp paths issue? But I'm not sure...
http://drupal.org/node/650664

In any case, consider me a subscriber :)

nplus1’s picture

thanks for the link! this patch http://drupal.org/files/issues/filefield_clear_file_cache.patch solves the problem!

hefox’s picture

#635854: Node links to original file path after creation until the node is saved again is where that patch is from, so please post any reviews there.

If that does fix it, sounds like this is a duplicate, so one of ya can mark it as such.

nplus1’s picture

Status: Active » Patch (to be ported)
hefox’s picture

Status: Patch (to be ported) » Closed (duplicate)

Er, I'm assuming they meant duplicate.