At now when I re-save entity, having multi-valued file field with any changes (eg same files rearranged and added), filename suffixes are changed randomly.
Eg, before saving:
delta 0 - myfilename.jpg
delta 1 - myfilename_0.jpg
delta 2 - myfilename_1.jpg
delta 3 - myfilename_2.jpg
And after saving entity with new file added:
delta 0 - myfilename_3.jpg
delta 1 - myfilename.jpg
delta 2 - myfilename_0.jpg
delta 3 - myfilename_1.jpg
delta 4 - myfilename_2.jpgOn next saving with rearranged files - all files are renamed via same way again.
After this site have many problems with cached images in browsers, because each image at same url is replaced with other image.
The problem is that FileField Paths module try to save files via same name, and file suffixes are managed by Drupal for prevent duplicates.
At now there are no modules, that can provide Drupal Tokens with field delta number, so solve this problem via Tokens is not possible.
So for solve this problem will be good to implement build-in handler for field delta value in FileField Path module. This maybe not standard token, but some other key (eg <delta>) for use only inside FileField Path fields (file path & file name).
What do you think about provided solution for described problem?
Comments