Skip to content

Commit 055c314

Browse files
committed
Merge remote-tracking branch 'origin/MC-17928' into 2.3-develop-pr57
2 parents d19ff10 + e713f45 commit 055c314

File tree

2 files changed

+164
-138
lines changed

2 files changed

+164
-138
lines changed

app/code/Magento/Customer/Model/FileUploaderDataResolver.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ private function getFileUploaderData(
8888
$file = $customerData[$attributeCode] ?? null;
8989

9090
/** @var FileProcessor $fileProcessor */
91-
$fileProcessor = $this->fileProcessorFactory->create([
92-
'entityTypeCode' => $entityType->getEntityTypeCode(),
93-
]);
91+
$fileProcessor = $this->fileProcessorFactory->create(['entityTypeCode' => $entityType->getEntityTypeCode()]);
9492

9593
if (!empty($file)
9694
&& $fileProcessor->isExist($file)
@@ -103,6 +101,7 @@ private function getFileUploaderData(
103101
'file' => $file,
104102
'size' => null !== $stat ? $stat['size'] : 0,
105103
'url' => $viewUrl ?? '',
104+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
106105
'name' => basename($file),
107106
'type' => $fileProcessor->getMimeType($file),
108107
],
@@ -138,9 +137,12 @@ public function overrideFileUploaderMetadata(
138137

139138
if (isset($config['validation']['file_extensions'])) {
140139
$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+
);
144146
}
145147

146148
$allowedExtensions = implode(' ', $allowedExtensions);
@@ -149,6 +151,7 @@ public function overrideFileUploaderMetadata(
149151
$url = $this->getFileUploadUrl($entityTypeCode);
150152

151153
$config = [
154+
'dataType' => $this->getMetadataValue($config, 'dataType'),
152155
'formElement' => 'fileUploader',
153156
'componentType' => 'fileUploader',
154157
'maxFileSize' => $maxFileSize,

0 commit comments

Comments
 (0)