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)
434434 * Get row edit URL.
435435 *
436436 * @param Mage_Catalog_Model_Resource_Eav_Attribute $row
437- * @return false
437+ * @return string
438438 */
439439 public function getRowUrl ($ row )
440440 {
441- return false ;
441+ return '' ;
442442 }
443443
444444 /**
Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ class Mage_ImportExport_Helper_Data extends Mage_Core_Helper_Data
3737 */
3838 public function getMaxUploadSize ()
3939 {
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 );
4143 }
4244
4345 /**
Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ protected function _getEntityAdapter()
6565
6666 if (isset ($ validTypes [$ this ->getEntity ()])) {
6767 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 ;
6971 } catch (Exception $ e ) {
7072 Mage::logException ($ e );
7173 Mage::throwException (
@@ -104,7 +106,9 @@ protected function _getWriter()
104106
105107 if (isset ($ validWriters [$ this ->getFileFormat ()])) {
106108 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 ;
108112 } catch (Exception $ e ) {
109113 Mage::logException ($ e );
110114 Mage::throwException (
@@ -185,8 +189,7 @@ public function exportFile()
185189 Mage::throwException (
186190 Mage::helper ('importexport ' )->__ ('There is no data for export ' )
187191 );
188- }
189- if ($ result ['rows ' ]) {
192+ } else {
190193 $ this ->addLogComment ([
191194 Mage::helper ('importexport ' )->__ ('Exported %s rows. ' , $ result ['rows ' ]),
192195 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
5252 /**
5353 * Entity type id.
5454 *
55- * @var int
55+ * @var string|null
5656 */
5757 protected $ _entityTypeId ;
5858
@@ -170,7 +170,10 @@ public function __construct()
170170 {
171171 $ entityCode = $ this ->getEntityTypeCode ();
172172 $ 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 ;
174177 }
175178
176179 /**
@@ -436,7 +439,7 @@ abstract public function getEntityTypeCode();
436439 /**
437440 * Entity type ID getter.
438441 *
439- * @return int
442+ * @return string|null
440443 */
441444 public function getEntityTypeId ()
442445 {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class Mage_ImportExport_Model_Import extends Mage_ImportExport_Model_Abstract
5656 /**
5757 * Entity invalidated indexes.
5858 *
59- * @var Mage_ImportExport_Model_Import_Entity_Abstract
59+ * @var array<string, array<int, string>>
6060 */
6161 protected static $ _entityInvalidatedIndexes = [
6262 'catalog_product ' => [
@@ -80,7 +80,9 @@ protected function _getEntityAdapter()
8080
8181 if (isset ($ validTypes [$ this ->getEntity ()])) {
8282 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 ;
8486 } catch (Exception $ e ) {
8587 Mage::logException ($ e );
8688 Mage::throwException (
@@ -366,7 +368,7 @@ public function expandSource()
366368 if (!empty ($ row [$ colName ])) {
367369 preg_match ($ regExps [$ regExpType ], $ row [$ colName ], $ m );
368370
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 ] : '' );
370372 }
371373 }
372374 $ 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
3333 /**
3434 * DB connection.
3535 *
36- * @var Varien_Convert_Adapter_Interface
36+ * @var Varien_Db_Adapter_Pdo_Mysql
3737 */
3838 protected $ _connection ;
3939
@@ -54,7 +54,7 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract
5454 /**
5555 * Entity type id.
5656 *
57- * @var int
57+ * @var string|null
5858 */
5959 protected $ _entityTypeId ;
6060
@@ -183,10 +183,13 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract
183183
184184 public function __construct ()
185185 {
186- $ entityType = Mage::getSingleton ('eav/config ' )->getEntityType ($ this ->getEntityTypeCode ());
186+ $ entityType = Mage::getSingleton ('eav/config ' )->getEntityType ($ this ->getEntityTypeCode ());
187187 $ this ->_entityTypeId = $ entityType ->getEntityTypeId ();
188188 $ 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 ;
190193 }
191194
192195 /**
@@ -398,7 +401,7 @@ abstract public function getEntityTypeCode();
398401 /**
399402 * Entity type ID getter.
400403 *
401- * @return int
404+ * @return string|null
402405 */
403406 public function getEntityTypeId ()
404407 {
Original file line number Diff line number Diff line change @@ -369,6 +369,7 @@ protected function _saveCustomers()
369369 $ entityRowsIn = [];
370370 $ entityRowsUp = [];
371371 $ attributes = [];
372+ $ entityId = null ;
372373
373374 $ oldCustomersToLower = array_change_key_case ($ this ->_oldCustomers , CASE_LOWER );
374375
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
416416 /**
417417 * url_key attribute id
418418 *
419- * @var int
419+ * @var string|false|null
420420 */
421421 protected $ _urlKeyAttributeId ;
422422
@@ -901,6 +901,8 @@ protected function _saveCustomOptions()
901901 'updated_at ' => Varien_Date::now ()
902902 ];
903903 }
904+
905+ $ prevOptionId = 0 ;
904906 if ($ rowIsMain ) {
905907 $ solidParams = [
906908 'option_id ' => $ nextOptionId ,
@@ -1152,6 +1154,7 @@ protected function _saveLinks()
11521154 $ productIds = [];
11531155 $ linkRows = [];
11541156 $ positionRows = [];
1157+ $ sku = null ;
11551158
11561159 foreach ($ bunch as $ rowNum => $ rowData ) {
11571160 $ this ->_filterRowData ($ rowData );
@@ -1362,6 +1365,7 @@ protected function _saveProducts()
13621365 $ tierPrices = [];
13631366 $ groupPrices = [];
13641367 $ mediaGallery = [];
1368+ $ rowSku = null ;
13651369 $ uploadedGalleryFiles = [];
13661370 $ previousType = null ;
13671371 $ previousAttributeSet = null ;
@@ -2207,7 +2211,7 @@ public function getAffectedEntityIds()
22072211 /**
22082212 * Get product url_key attribute id
22092213 *
2210- * @return null|int
2214+ * @return string|false|null
22112215 */
22122216 protected function _getUrlKeyAttributeId ()
22132217 {
Original file line number Diff line number Diff line change @@ -356,6 +356,8 @@ public function saveData()
356356 $ newSku = $ this ->_entityModel ->getNewSku ();
357357 $ oldSku = $ this ->_entityModel ->getOldSku ();
358358 $ productSuperData = [];
359+ $ productSuperAttrId = null ;
360+ $ productId = null ;
359361 $ productData = null ;
360362 /** @var Mage_ImportExport_Model_Resource_Helper_Mysql4 $helper */
361363 $ helper = Mage::getResourceHelper ('importexport ' );
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ public function saveData()
6565 $ newSku = $ this ->_entityModel ->getNewSku ();
6666 $ oldSku = $ this ->_entityModel ->getOldSku ();
6767 $ attributes = [];
68+ $ productData = [];
6869
6970 // pre-load attributes parameters
7071 $ select = $ connection ->select ()
@@ -101,6 +102,7 @@ public function saveData()
101102 } else {
102103 continue ;
103104 }
105+
104106 $ scope = $ this ->_entityModel ->getRowScope ($ rowData );
105107 if (Mage_ImportExport_Model_Import_Entity_Product::SCOPE_DEFAULT == $ scope ) {
106108 $ productData = $ newSku [$ rowData [Mage_ImportExport_Model_Import_Entity_Product::COL_SKU ]];
You can’t perform that action at this time.
0 commit comments