Sterc / FileSluggy

MODX Plugin to sanitize filename after uploading it.
9 stars 8 forks source link

FileSluggy version 1.3.1 doesn't work in modx 2.7.3, php version 7.3 #26

Open pawelpvi opened 4 years ago

pawelpvi commented 4 years ago

Filenames are not changed, eg: T%ąśds.txt uploaded with the same name

pawelpvi commented 4 years ago

I found that it's related to conflict with plugin which is trying to send file to optimize with tinypng api. Setting different priority OnFileManagerUpload didn't solvedthe problem.

jcdm commented 3 years ago

I know it's almost a year later, but I can speak to a similar issue. I have a plugin which creates PDF thumbnails on upload but had the same issue - I needed it to run AFTER FileSluggy using the name that FileSluggy had given the file.

I have a PR sitting here that triggers the FileSluggyOnUpdateFilename event whether or not a rename took place. That allows you to chain your plugin to this while receiving some information about the media source etc. I've had this working with the MODX 2.7 family and now the 2.8 family as well. I cannot vouch for it under MODX 3.

If you make the changes to the FileSluggy plugin included in that PR then hook your tinypng plugin to the FileSluggy event instead of the upload event, you might find that gets you further.