Skip to content

Commit d5cc340

Browse files
authored
ENGCOM-4152: Fix for issue 19983 Can't upload customer Image attribute programmatically #19988
2 parents d3ca9d1 + 0e34c7b commit d5cc340

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

app/code/Magento/Eav/Model/Attribute/Data/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected function _validateByRules($value)
146146
return $this->_fileValidator->getMessages();
147147
}
148148

149-
if (empty($value['tmp_name'])) {
149+
if (!empty($value['tmp_name']) && !file_exists($value['tmp_name'])) {
150150
return [__('"%1" is not a valid file.', $label)];
151151
}
152152

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ define([
1616
'Magento_Ui/js/form/element/abstract',
1717
'mage/backend/notification',
1818
'mage/translate',
19-
'jquery/file-uploader'
19+
'jquery/file-uploader',
20+
'mage/adminhtml/tools'
2021
], function ($, _, utils, uiAlert, validator, Element, notification, $t) {
2122
'use strict';
2223

app/code/Magento/Variable/view/adminhtml/web/variables.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ define([
1616
'Magento_Variable/js/custom-directive-generator',
1717
'Magento_Ui/js/lib/spinner',
1818
'jquery/ui',
19-
'prototype'
19+
'prototype',
20+
'mage/adminhtml/tools'
2021
], function (jQuery, notification, $t, wysiwyg, registry, mageApply, utils, configGenerator, customGenerator, loader) {
2122
'use strict';
2223

lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ define([
99
'Magento_Variable/js/config-directive-generator',
1010
'Magento_Variable/js/custom-directive-generator',
1111
'wysiwygAdapter',
12-
'jquery'
12+
'jquery',
13+
'mage/adminhtml/tools'
1314
], function (configDirectiveGenerator, customDirectiveGenerator, wysiwyg, jQuery) {
1415
return function (config) {
1516
tinymce.create('tinymce.plugins.magentovariable', {

0 commit comments

Comments
 (0)