File tree Expand file tree Collapse file tree 14 files changed +57
-231
lines changed
Usa/Model/Shipping/Carrier Expand file tree Collapse file tree 14 files changed +57
-231
lines changed Original file line number Diff line number Diff line change @@ -434,11 +434,11 @@ public function getFilterElementName($attributeCode)
434
434
* Get row edit URL.
435
435
*
436
436
* @param Mage_Catalog_Model_Resource_Eav_Attribute $row
437
- * @return false
437
+ * @return string
438
438
*/
439
439
public function getRowUrl ($ row )
440
440
{
441
- return false ;
441
+ return '' ;
442
442
}
443
443
444
444
/**
Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ class Mage_ImportExport_Helper_Data extends Mage_Core_Helper_Data
37
37
*/
38
38
public function getMaxUploadSize ()
39
39
{
40
- return min (ini_get ('post_max_size ' ), ini_get ('upload_max_filesize ' ));
40
+ $ postMaxSizeBytes = ini_parse_quantity (ini_get ('post_max_size ' ));
41
+ $ uploadMaxSizeBytes = ini_parse_quantity (ini_get ('upload_max_filesize ' ));
42
+ return min ($ postMaxSizeBytes , $ uploadMaxSizeBytes );
41
43
}
42
44
43
45
/**
Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ protected function _getEntityAdapter()
65
65
66
66
if (isset ($ validTypes [$ this ->getEntity ()])) {
67
67
try {
68
- $ this ->_entityAdapter = Mage::getModel ($ validTypes [$ this ->getEntity ()]['model ' ]);
68
+ /** @var Mage_ImportExport_Model_Export_Entity_Abstract $_entityAdapter */
69
+ $ _entityAdapter = Mage::getModel ($ validTypes [$ this ->getEntity ()]['model ' ]);
70
+ $ this ->_entityAdapter = $ _entityAdapter ;
69
71
} catch (Exception $ e ) {
70
72
Mage::logException ($ e );
71
73
Mage::throwException (
@@ -104,7 +106,9 @@ protected function _getWriter()
104
106
105
107
if (isset ($ validWriters [$ this ->getFileFormat ()])) {
106
108
try {
107
- $ this ->_writer = Mage::getModel ($ validWriters [$ this ->getFileFormat ()]['model ' ]);
109
+ /** @var Mage_ImportExport_Model_Export_Adapter_Abstract $_writer */
110
+ $ _writer = Mage::getModel ($ validWriters [$ this ->getFileFormat ()]['model ' ]);
111
+ $ this ->_writer = $ _writer ;
108
112
} catch (Exception $ e ) {
109
113
Mage::logException ($ e );
110
114
Mage::throwException (
@@ -185,8 +189,7 @@ public function exportFile()
185
189
Mage::throwException (
186
190
Mage::helper ('importexport ' )->__ ('There is no data for export ' )
187
191
);
188
- }
189
- if ($ result ['rows ' ]) {
192
+ } else {
190
193
$ this ->addLogComment ([
191
194
Mage::helper ('importexport ' )->__ ('Exported %s rows. ' , $ result ['rows ' ]),
192
195
Mage::helper ('importexport ' )->__ ('Export has been done. ' )
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ abstract class Mage_ImportExport_Model_Export_Entity_Abstract
52
52
/**
53
53
* Entity type id.
54
54
*
55
- * @var int
55
+ * @var string|null
56
56
*/
57
57
protected $ _entityTypeId ;
58
58
@@ -170,7 +170,10 @@ public function __construct()
170
170
{
171
171
$ entityCode = $ this ->getEntityTypeCode ();
172
172
$ this ->_entityTypeId = Mage::getSingleton ('eav/config ' )->getEntityType ($ entityCode )->getEntityTypeId ();
173
- $ this ->_connection = Mage::getSingleton ('core/resource ' )->getConnection ('write ' );
173
+
174
+ /** @var Varien_Db_Adapter_Pdo_Mysql $_connection */
175
+ $ _connection = Mage::getSingleton ('core/resource ' )->getConnection ('write ' );
176
+ $ this ->_connection = $ _connection ;
174
177
}
175
178
176
179
/**
@@ -436,7 +439,7 @@ abstract public function getEntityTypeCode();
436
439
/**
437
440
* Entity type ID getter.
438
441
*
439
- * @return int
442
+ * @return string|null
440
443
*/
441
444
public function getEntityTypeId ()
442
445
{
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class Mage_ImportExport_Model_Import extends Mage_ImportExport_Model_Abstract
56
56
/**
57
57
* Entity invalidated indexes.
58
58
*
59
- * @var Mage_ImportExport_Model_Import_Entity_Abstract
59
+ * @var array<string, array<int, string>>
60
60
*/
61
61
protected static $ _entityInvalidatedIndexes = [
62
62
'catalog_product ' => [
@@ -80,7 +80,9 @@ protected function _getEntityAdapter()
80
80
81
81
if (isset ($ validTypes [$ this ->getEntity ()])) {
82
82
try {
83
- $ this ->_entityAdapter = Mage::getModel ($ validTypes [$ this ->getEntity ()]['model ' ]);
83
+ /** @var Mage_ImportExport_Model_Import_Entity_Abstract $_entityAdapter */
84
+ $ _entityAdapter = Mage::getModel ($ validTypes [$ this ->getEntity ()]['model ' ]);
85
+ $ this ->_entityAdapter = $ _entityAdapter ;
84
86
} catch (Exception $ e ) {
85
87
Mage::logException ($ e );
86
88
Mage::throwException (
@@ -366,7 +368,7 @@ public function expandSource()
366
368
if (!empty ($ row [$ colName ])) {
367
369
preg_match ($ regExps [$ regExpType ], $ row [$ colName ], $ m );
368
370
369
- $ row [$ colName ] = $ m [1 ] . ($ m [2 ] + $ size ) . ($ regExpType == 'middle ' ? $ m [3 ] : '' );
371
+ $ row [$ colName ] = $ m [1 ] . (( int ) $ m [2 ] + $ size ) . ($ regExpType == 'middle ' ? $ m [3 ] : '' );
370
372
}
371
373
}
372
374
$ writer ->writeRow ($ row );
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract
33
33
/**
34
34
* DB connection.
35
35
*
36
- * @var Varien_Convert_Adapter_Interface
36
+ * @var Varien_Db_Adapter_Pdo_Mysql
37
37
*/
38
38
protected $ _connection ;
39
39
@@ -54,7 +54,7 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract
54
54
/**
55
55
* Entity type id.
56
56
*
57
- * @var int
57
+ * @var string|null
58
58
*/
59
59
protected $ _entityTypeId ;
60
60
@@ -183,10 +183,13 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract
183
183
184
184
public function __construct ()
185
185
{
186
- $ entityType = Mage::getSingleton ('eav/config ' )->getEntityType ($ this ->getEntityTypeCode ());
186
+ $ entityType = Mage::getSingleton ('eav/config ' )->getEntityType ($ this ->getEntityTypeCode ());
187
187
$ this ->_entityTypeId = $ entityType ->getEntityTypeId ();
188
188
$ this ->_dataSourceModel = Mage_ImportExport_Model_Import::getDataSourceModel ();
189
- $ this ->_connection = Mage::getSingleton ('core/resource ' )->getConnection ('write ' );
189
+
190
+ /** @var Varien_Db_Adapter_Pdo_Mysql $_connection */
191
+ $ _connection = Mage::getSingleton ('core/resource ' )->getConnection ('write ' );
192
+ $ this ->_connection = $ _connection ;
190
193
}
191
194
192
195
/**
@@ -398,7 +401,7 @@ abstract public function getEntityTypeCode();
398
401
/**
399
402
* Entity type ID getter.
400
403
*
401
- * @return int
404
+ * @return string|null
402
405
*/
403
406
public function getEntityTypeId ()
404
407
{
Original file line number Diff line number Diff line change @@ -369,6 +369,7 @@ protected function _saveCustomers()
369
369
$ entityRowsIn = [];
370
370
$ entityRowsUp = [];
371
371
$ attributes = [];
372
+ $ entityId = null ;
372
373
373
374
$ oldCustomersToLower = array_change_key_case ($ this ->_oldCustomers , CASE_LOWER );
374
375
Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo
416
416
/**
417
417
* url_key attribute id
418
418
*
419
- * @var int
419
+ * @var string|false|null
420
420
*/
421
421
protected $ _urlKeyAttributeId ;
422
422
@@ -901,6 +901,8 @@ protected function _saveCustomOptions()
901
901
'updated_at ' => Varien_Date::now ()
902
902
];
903
903
}
904
+
905
+ $ prevOptionId = 0 ;
904
906
if ($ rowIsMain ) {
905
907
$ solidParams = [
906
908
'option_id ' => $ nextOptionId ,
@@ -1152,6 +1154,7 @@ protected function _saveLinks()
1152
1154
$ productIds = [];
1153
1155
$ linkRows = [];
1154
1156
$ positionRows = [];
1157
+ $ sku = null ;
1155
1158
1156
1159
foreach ($ bunch as $ rowNum => $ rowData ) {
1157
1160
$ this ->_filterRowData ($ rowData );
@@ -1362,6 +1365,7 @@ protected function _saveProducts()
1362
1365
$ tierPrices = [];
1363
1366
$ groupPrices = [];
1364
1367
$ mediaGallery = [];
1368
+ $ rowSku = null ;
1365
1369
$ uploadedGalleryFiles = [];
1366
1370
$ previousType = null ;
1367
1371
$ previousAttributeSet = null ;
@@ -2207,7 +2211,7 @@ public function getAffectedEntityIds()
2207
2211
/**
2208
2212
* Get product url_key attribute id
2209
2213
*
2210
- * @return null|int
2214
+ * @return string|false|null
2211
2215
*/
2212
2216
protected function _getUrlKeyAttributeId ()
2213
2217
{
Original file line number Diff line number Diff line change @@ -356,6 +356,8 @@ public function saveData()
356
356
$ newSku = $ this ->_entityModel ->getNewSku ();
357
357
$ oldSku = $ this ->_entityModel ->getOldSku ();
358
358
$ productSuperData = [];
359
+ $ productSuperAttrId = null ;
360
+ $ productId = null ;
359
361
$ productData = null ;
360
362
/** @var Mage_ImportExport_Model_Resource_Helper_Mysql4 $helper */
361
363
$ helper = Mage::getResourceHelper ('importexport ' );
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ public function saveData()
65
65
$ newSku = $ this ->_entityModel ->getNewSku ();
66
66
$ oldSku = $ this ->_entityModel ->getOldSku ();
67
67
$ attributes = [];
68
+ $ productData = [];
68
69
69
70
// pre-load attributes parameters
70
71
$ select = $ connection ->select ()
@@ -101,6 +102,7 @@ public function saveData()
101
102
} else {
102
103
continue ;
103
104
}
105
+
104
106
$ scope = $ this ->_entityModel ->getRowScope ($ rowData );
105
107
if (Mage_ImportExport_Model_Import_Entity_Product::SCOPE_DEFAULT == $ scope ) {
106
108
$ productData = $ newSku [$ rowData [Mage_ImportExport_Model_Import_Entity_Product::COL_SKU ]];
You can’t perform that action at this time.
0 commit comments