Skip to content

Commit dd9e8cf

Browse files
author
Serhiy Zhovnir
committed
#20376 Fix issue with file uploading if an upload field is disabled
1 parent 2f30dde commit dd9e8cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,12 @@ define([
344344
* @param {Object} data - File data that will be uploaded.
345345
*/
346346
onBeforeFileUpload: function (e, data) {
347+
if (this.disabled()) {
348+
this.notifyError($t('was not uploaded'));
349+
350+
return;
351+
}
352+
347353
var file = data.files[0],
348354
allowed = this.isFileAllowed(file),
349355
target = $(e.target);

0 commit comments

Comments
 (0)