When adding files through the Multiple Document upload functionality, then refreshing the upload window, then attempting to re-save it with a custom Document Type with required fields, publshing results in an error indicating an-unexpected-error-occurred-while-saving-your-document.
Note: After further testing, there seems to be strong evidence that the unexpected error appears only if we select a document type with a required field. All of the OOTB document types do not cause this behavior to occur.
The problem here is twofold:
- The files are not uploaded/saved with the selected Document Type
- The key is not translated
This emulates a scenario when files are dragged into the folder via the Multiple Upload functionality, but there is server slowness/unresponsiveness which prompts the user to refresh. Although this might seem like a unique use case, this is a realistic scenario, and the resulting behavior is problematic.
Steps to Reproduce
- Go to Liferay DXP -> Contents -> Documents & Media
- Open Document Type tab and create new document type as "image type" for the title.
- Open up the Main Metadata Fields dropdown
- Give it a name (DocType), then add a Boolean field, and configure it with "Required – Yes"
- Save the Document Type
- Go back to Documents & Media
- Select multiple upload and drag & drop (not open up a dialog and select files) a group of a few test documents
- Refresh the page, you will see "These files have been previously uploaded but not actually saved. Please save or delete them before they are removed." message.
- Click the check box above the files to be saved to select all
- On the right hand side, select Document Type and select the DocType, and check the Boolean
The files aren't uploaded and the UI displays an untranslated key an-unexpected-error-occurred-while-saving-your-document, (Note: This string is not translated in Japanese or English).
Files must be uploaded correctly.
7.1.x Private Commit: 40d9e186b7f81ae2c027e7e89fdb1ad890d6eb9f