When uploading a file using the upload widget, the `attachments.js` file is invoked. Once the widget finishes uploading the file, it triggers the `wiki:html5upload:done` event, which is also handled by `attachments.js`. This script attempts to refresh the attachment section's LiveTable—even if the section is not present on the page—resulting in an error being thrown in the browser console. Steps to Reproduce 1. Create a new page. 2. Add the following code to the page: ```xwiki velocity $doc.getURL() #set ($discard = $xwiki.ssfx.use('uicomponents/widgets/upload.css', true)) #set ($discard = $xwiki.jsfx.use('uicomponents/widgets/upload.js', { 'forceSkinAction': true, 'language': $xcontext.locale } )) $doc.getURL("upload") html <form action="$doc.getURL("upload")"> ## CSRF prevention <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" /> <input type="file" id="myFileInput" name="nameUsedToAccessTheFileOnTheServer" /> </form> /html /velocity ``` 3. Add a JavaScript object to the page. 4. Add the following code to the object: ```javascript var targetInput = $('myFileInput'); if (targetInput) { new XWiki.FileUploader(targetInput, { autoUpload: true, progressAutohide: true } ); } ``` 5. Upload a file. Expected Output The file is uploaded without any error. Actual Output The file is uploaded, but an error appears in the browser console about accessing an object that is not present in the DOM. |