revolution
revolution copied to clipboard
Update uploadObjectsToContainer method
Update uploadObjectsToContainer so the files array passed to the OnFileManagerUpload event includes an up-to-date version of $objects. So if a file name has been renamed, $objects passed to the OnFileManagerUpload also reflects these changes.
What does it do?
This ensures that $objects is kept up-to-date after looping through the array.
Why is it needed?
Having an old file name triggered an unforced error in FileSluggy because the old file name was passed instead of the renamed filename.
How to test
Install FileSluggy and try to upload a file with a name such as "Modx - Test.jpg". Now you'll see the unforced error:
Error
- Modx - Test.jpg: The file is not a regular file and cannot be removed.
Even though the file has been uploaded successfully and can also be removed.