Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overwriting the same asset filename #21996

Merged
merged 5 commits into from Apr 25, 2018

Conversation

cpirich
Copy link
Contributor

@cpirich cpirich commented Apr 23, 2018

  • If you use the Manage Assets dialog to upload a file that already exists in your project, we had a couple of problems, which are now fixed:
    1. The assetListStore.add() function was always appending the asset to the assets array, resulting in the old (replaced) asset and the new asset in the asset list at the same time. We now will first attempt to remove any asset with the same filename before adding to the array.
    2. Due to cache lifetime, you would still see the old image thumbnail. Given that we will have a string timestamp value in the assetListStore after a recent upload, we now pipe that through and use it to create a cacheBustSuffix of the form ?t=1524501023442 in the asset thumbnail

@cpirich cpirich requested a review from islemaster April 25, 2018 16:03
Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@cpirich cpirich merged commit 5facd94 into staging Apr 25, 2018
@cpirich cpirich deleted the assets_fix_overwrite_same_filename branch April 25, 2018 20:34
@cpirich cpirich restored the assets_fix_overwrite_same_filename branch April 27, 2018 19:16
@cpirich cpirich deleted the assets_fix_overwrite_same_filename branch April 27, 2018 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants