@@ -88,9 +88,7 @@ private function getFileUploaderData(
88
88
$ file = $ customerData [$ attributeCode ] ?? null ;
89
89
90
90
/** @var FileProcessor $fileProcessor */
91
- $ fileProcessor = $ this ->fileProcessorFactory ->create ([
92
- 'entityTypeCode ' => $ entityType ->getEntityTypeCode (),
93
- ]);
91
+ $ fileProcessor = $ this ->fileProcessorFactory ->create (['entityTypeCode ' => $ entityType ->getEntityTypeCode ()]);
94
92
95
93
if (!empty ($ file )
96
94
&& $ fileProcessor ->isExist ($ file )
@@ -103,6 +101,7 @@ private function getFileUploaderData(
103
101
'file ' => $ file ,
104
102
'size ' => null !== $ stat ? $ stat ['size ' ] : 0 ,
105
103
'url ' => $ viewUrl ?? '' ,
104
+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
106
105
'name ' => basename ($ file ),
107
106
'type ' => $ fileProcessor ->getMimeType ($ file ),
108
107
],
@@ -138,9 +137,12 @@ public function overrideFileUploaderMetadata(
138
137
139
138
if (isset ($ config ['validation ' ]['file_extensions ' ])) {
140
139
$ allowedExtensions = explode (', ' , $ config ['validation ' ]['file_extensions ' ]);
141
- array_walk ($ allowedExtensions , function (&$ value ) {
142
- $ value = strtolower (trim ($ value ));
143
- });
140
+ array_walk (
141
+ $ allowedExtensions ,
142
+ function (&$ value ) {
143
+ $ value = strtolower (trim ($ value ));
144
+ }
145
+ );
144
146
}
145
147
146
148
$ allowedExtensions = implode (' ' , $ allowedExtensions );
@@ -149,6 +151,7 @@ public function overrideFileUploaderMetadata(
149
151
$ url = $ this ->getFileUploadUrl ($ entityTypeCode );
150
152
151
153
$ config = [
154
+ 'dataType ' => $ this ->getMetadataValue ($ config , 'dataType ' ),
152
155
'formElement ' => 'fileUploader ' ,
153
156
'componentType ' => 'fileUploader ' ,
154
157
'maxFileSize ' => $ maxFileSize ,
0 commit comments