Skip to content

Commit 735257a

Browse files
ENGCOM-3937: #20376 Fix issue with file uploading if an upload field is disabled #20461
- Merge Pull Request #20461 from serhiyzhovnir/magento2:issue-20376-fixed-2.3 - Merged commits: 1. dd9e8cf 2. 85c4e92 3. d91d0ed 4. 3671bbe 5. b0363af
2 parents 92118f5 + b0363af commit 735257a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,5 @@ CSV,CSV
190190
"Please enter at least {0} characters.","Please enter at least {0} characters."
191191
"Please enter a value between {0} and {1} characters long.","Please enter a value between {0} and {1} characters long."
192192
"Please enter a value between {0} and {1}.","Please enter a value between {0} and {1}."
193-
"was not uploaded","was not uploaded"
193+
"was not uploaded","was not uploaded"
194+
"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
@@ -348,6 +348,12 @@ define([
348348
allowed = this.isFileAllowed(file),
349349
target = $(e.target);
350350

351+
if (this.disabled()) {
352+
this.notifyError($t('The file upload field is disabled.'));
353+
354+
return;
355+
}
356+
351357
if (allowed.passed) {
352358
target.on('fileuploadsend', function (event, postData) {
353359
postData.data.append('param_name', this.paramName);

0 commit comments

Comments
 (0)