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 broken JS on Cloud uploader when changing dirs #14542

Merged
merged 8 commits into from
Mar 11, 2024

Conversation

timkelty
Copy link
Contributor

@timkelty timkelty commented Mar 6, 2024

Following #14439, a JS error was thrown when navigating directories.
This is because AssetIndex was calling .fileupload(), which can't be assumed, as only hte core Uploader uses the jquery uploader plugin.

Changes

  • When selecting source, make onSelectSource fire before onSourcePathChange to be less awkward.
  • With onSelectSource fired first, we can be certain out uploader is created by the time we get to onSourcePathChange
  • Don't call fileupload methods if the plugin wasn't instantiated (eg if uploading is disabled)
  • Eliminate duplicate inputs by settingreplaceFileInput = false, which is only needed for very old iframe uploading.

History

Test cases

  • permissions
    • create 2 volumes
    • user can do everything for vol1
    • user can only view vol2
    • vol1 has one subfolder
    • go to vol1 > subfolder & upload a file - all good
    • go to vol2 - upload button is disabled and you can’t upload - all good
    • go to vol1, you should be deep linked into the subfolder (cause that’s where you were last); try to upload a file
  • Assets page
    • upload button
    • drag to upload
  • Assets field
    • select via modal
    • upload directly
    • upload directly via drag

@timkelty timkelty requested a review from brandonkelly March 7, 2024 17:53
@timkelty timkelty self-assigned this Mar 7, 2024
@timkelty timkelty added the bug label Mar 7, 2024
# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
#	src/web/assets/pluginstore/dist/js/app.js
#	src/web/assets/pluginstore/dist/js/app.js.map
[ci skip]
@brandonkelly brandonkelly merged commit 6e1e674 into develop Mar 11, 2024
@brandonkelly brandonkelly deleted the bugfix/cloud-uploader branch March 11, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants