Skip to content

Commit b9390c9

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

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/code/Magento/Ui/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,4 @@ CSV,CSV
202202
"Please enter at least {0} characters.","Please enter at least {0} characters."
203203
"Please enter a value between {0} and {1} characters long.","Please enter a value between {0} and {1} characters long."
204204
"Please enter a value between {0} and {1}.","Please enter a value between {0} and {1}."
205+
"The file upload field is disabled.","The file upload field is disabled."

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
@@ -328,6 +328,12 @@ define([
328328
allowed = this.isFileAllowed(file),
329329
target = $(e.target);
330330

331+
if (this.disabled()) {
332+
this.notifyError($t('The file upload field is disabled.'));
333+
334+
return;
335+
}
336+
331337
if (allowed.passed) {
332338
target.on('fileuploadsend', function (event, postData) {
333339
postData.data.append('param_name', this.paramName);

0 commit comments

Comments
 (0)