Skip to content

Commit 4870075

Browse files
MAGETWO-95645: Custom file attribute works incorrect
- fix tests
1 parent d5594fc commit 4870075

File tree

2 files changed

+6
-8
lines changed
  • app/code/Magento/Eav/Model/Attribute/Data
  • lib/internal/Magento/Framework/Data/Form/Element

2 files changed

+6
-8
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ public function extractValue(RequestInterface $request)
120120
}
121121

122122
/**
123-
* Validate file by attribute validate rules
124-
* Return array of errors
123+
* Validate file by attribute validate rules and return array of errors
125124
*
126125
* @param array $value
127126
* @return string[]
@@ -180,7 +179,8 @@ public function validateValue($value)
180179
$dir = $this->_directory->getAbsolutePath($this->getAttribute()->getEntityType()->getEntityTypeCode());
181180
$fileData = [
182181
'size' => filesize($dir . $value),
183-
'name' => $value
182+
'name' => $value,
183+
'tmp_name' => $dir . $value
184184
];
185185
}
186186

lib/internal/Magento/Framework/Data/Form/Element/Text.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Form text element
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
11-
*/
127
namespace Magento\Framework\Data\Form\Element;
138

149
use Magento\Framework\Escaper;
1510

11+
/**
12+
* Form text element
13+
*/
1614
class Text extends AbstractElement
1715
{
1816
/**

0 commit comments

Comments
 (0)