LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

File Upload Improved - Upload Screen Component - Error Thrown on Upload

Open zacharybuckHM opened this issue 1 year ago • 2 comments

FileUploadsImproved appears to be broken in my Summer '22 Patch 13.3 Salesforce Sandbox. The error thrown upon uploading a file looks like it points to the key parameter on line 33 of fileUploadImproved.html. I might be wrong about that!

Interestingly, this is not a problem for me in Production, which is on Summer '22 Patch 13.

Steps to reproduce

Steps to reproduce the behavior:

  1. Install version 1.8.2 of the FileUploadImproved package into a Salesforce Sandbox with version Summer '22 Patch 13.3
  2. Add the File Upload Improved component to a flow screen
  3. Run or debug flow, uploading a file to the component
  4. Allow upload to complete; close progress screen
  5. See error

Note that when debugging, the error is logged in the console, but not displayed. Regardless, the list item is not displayed on the flow screen.

Expected behaviour

Uploaded file should be displayed above or below upload field (depending on options set on component).

Actual behaviour

Error is thrown, and no file is displayed.

Screenshots

Please excuse the blurring; none of it is relevant, I promise! Blurred to ensure my company is ok with it :) SCR-20220722-mi5

With Lightning Debugging on, this is the line referenced in the stack trace. SCR-20220722-mrs

Debug Logs

Debug log captured from Javascript Console in web browser.

Console Error Statement
Uncaught (in promise) Error: Invalid key value "[object Object]" in [object:vm FileUpload (44)]. Key must be a string or number.
    at Object.fail (aura_proddebug.js:5105:13)
    at k (aura_proddebug.js:9363:26)
    at eval (fileUploadImproved.js:197:16)
    at i (aura_proddebug.js:9259:25)
    at tmpl (fileUploadImproved.js:194:375)
    at aura_proddebug.js:9881:29
    at ReactiveObserver.observe (aura_proddebug.js:5817:15)
    at isUpdatingTemplate (aura_proddebug.js:9837:15)
    at runWithBoundaryProtection (aura_proddebug.js:10696:7)
    at evaluateTemplate (aura_proddebug.js:9830:7)

zacharybuckHM avatar Jul 22 '22 23:07 zacharybuckHM

I'm having this same issue - I'm not sure if that's a useful contribution!

louisskelton avatar Aug 05 '22 13:08 louisskelton

Hey all, thanks for pointing this out. This is a bug the key in line 33 of html needs to be switched to {objFile.contentVersionId}. I'll eventually get around to updating the source, but if you want to make the change and confirm that works, that would be helpful!

rygramer avatar Aug 15 '22 17:08 rygramer

Thanks for the fix, Ben! It's in new version 1.8.3 at https://unofficialsf.com/from-josh-dayment-improved-file-upload-in-flow-screens/

alexed1 avatar Sep 12 '22 04:09 alexed1

Thanks @BenJenkin! I've been meaning to do this. So appreciate you taking the reigns.

rygramer-usds avatar Sep 14 '22 01:09 rygramer-usds