Skip to content

Commit f63d74c

Browse files
#11252: fix adminhtml file attribute edit form
1 parent 9eddfcc commit f63d74c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public function saveTemporaryFile($fileId)
181181
);
182182

183183
$result = $uploader->save($path);
184+
unset($result['path']);
184185
if (!$result) {
185186
throw new \Magento\Framework\Exception\LocalizedException(
186187
__('File can not be saved to the destination folder.')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function upload()
110110
$result = $fileProcessor->saveTemporaryFile($this->scope . '[' . $this->getAttributeCode() . ']');
111111

112112
// Update tmp_name param. Required for attribute validation!
113-
$result['tmp_name'] = $result['path'] . '/' . ltrim($result['file'], '/');
113+
$result['tmp_name'] = ltrim($result['file'], '/');
114114

115115
$result['url'] = $fileProcessor->getViewUrl(
116116
FileProcessor::TMP_DIR . '/' . ltrim($result['name'], '/'),

app/code/Magento/Customer/Test/Unit/Model/FileUploaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function testUpload()
140140
'name' => $resultFileName,
141141
'file' => $resultFileName,
142142
'path' => $resultFilePath,
143-
'tmp_name' => $resultFilePath . $resultFileName,
143+
'tmp_name' => ltrim($resultFileName, '/'),
144144
'url' => $resultFileUrl,
145145
];
146146

0 commit comments

Comments
 (0)