@@ -1198,7 +1198,7 @@ protected function _initTypeModels()
1198
1198
// phpcs:disable Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge
1199
1199
$ this ->_fieldsMap = array_merge ($ this ->_fieldsMap , $ model ->getCustomFieldsMapping ());
1200
1200
$ this ->_specialAttributes = array_merge ($ this ->_specialAttributes , $ model ->getParticularAttributes ());
1201
- // phpcs:enable
1201
+ // phpcs:enable
1202
1202
}
1203
1203
$ this ->_initErrorTemplates ();
1204
1204
// remove doubles
@@ -2035,9 +2035,9 @@ protected function _saveProductTierPrices(array $tierPriceData)
2035
2035
protected function _getUploader ()
2036
2036
{
2037
2037
if ($ this ->_fileUploader === null ) {
2038
- $ this -> _fileUploader = $ this ->_uploaderFactory ->create ();
2038
+ $ fileUploader = $ this ->_uploaderFactory ->create ();
2039
2039
2040
- $ this -> _fileUploader ->init ();
2040
+ $ fileUploader ->init ();
2041
2041
2042
2042
$ dirConfig = DirectoryList::getDefaultConfig ();
2043
2043
$ dirAddon = $ dirConfig [DirectoryList::MEDIA ][DirectoryList::PATH ];
@@ -2048,7 +2048,7 @@ protected function _getUploader()
2048
2048
$ tmpPath = $ dirAddon . '/ ' . $ this ->_mediaDirectory ->getRelativePath ('import ' );
2049
2049
}
2050
2050
2051
- if (!$ this -> _fileUploader ->setTmpDir ($ tmpPath )) {
2051
+ if (!$ fileUploader ->setTmpDir ($ tmpPath )) {
2052
2052
throw new LocalizedException (
2053
2053
__ ('File directory \'%1 \' is not readable. ' , $ tmpPath )
2054
2054
);
@@ -2057,11 +2057,13 @@ protected function _getUploader()
2057
2057
$ destinationPath = $ dirAddon . '/ ' . $ this ->_mediaDirectory ->getRelativePath ($ destinationDir );
2058
2058
2059
2059
$ this ->_mediaDirectory ->create ($ destinationPath );
2060
- if (!$ this -> _fileUploader ->setDestDir ($ destinationPath )) {
2060
+ if (!$ fileUploader ->setDestDir ($ destinationPath )) {
2061
2061
throw new LocalizedException (
2062
2062
__ ('File directory \'%1 \' is not writable. ' , $ destinationPath )
2063
2063
);
2064
2064
}
2065
+
2066
+ $ this ->_fileUploader = $ fileUploader ;
2065
2067
}
2066
2068
return $ this ->_fileUploader ;
2067
2069
}
0 commit comments