Skip to content

Commit 5d27e83

Browse files
authored
Merge branch 'main' into ddev-localdev
2 parents e7cccf7 + 9f27305 commit 5d27e83

File tree

24 files changed

+392
-330
lines changed

24 files changed

+392
-330
lines changed

.ddev/commands/web/magerun

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
## Description: Execute n98-magerun
4+
## Usage: magerun
5+
## Example: "ddev magerun"
6+
7+
if [ ! -f vendor/bin/n98-magerun ]; then
8+
read -r -p "n98-magerun is not installed. Do you want to install it? [y/N] " INSTALL_MAGE
9+
INSTALL_MAGERUN=${INSTALL_MAGERUN,,} # to lower
10+
if [[ "${INSTALL_MAGERUN}" =~ ^(yes|y) ]]; then
11+
composer require --dev n98/magerun:dev-develop
12+
else
13+
exit 1
14+
fi
15+
fi
16+
17+
php -d error_reporting="E_ALL ^E_DEPRECATED" vendor/bin/n98-magerun "$@"

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ for more information.
368368
* [Lee Saferite](https://github.com/LeeSaferite)
369369
* [Mohamed Elidrissi](https://github.com/elidrissidev)
370370
* [Ng Kiat Siong](https://github.com/kiatng)
371-
* [Sven Reichel](https://github.com/sreichel)
372371
* [Tymoteusz Motylewski](https://github.com/tmotyl)
373372

374373
## License

app/code/core/Mage/Core/etc/system.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,13 +1520,6 @@
15201520
</no_route>
15211521
</fields>
15221522
</default>
1523-
<polls translate="label">
1524-
<label>Polls</label>
1525-
<sort_order>40</sort_order>
1526-
<show_in_default>1</show_in_default>
1527-
<show_in_website>1</show_in_website>
1528-
<show_in_store>1</show_in_store>
1529-
</polls>
15301523
<cookie translate="label">
15311524
<label>Session Cookie Management</label>
15321525
<sort_order>50</sort_order>

app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
/**

app/code/core/Mage/ImportExport/Helper/Data.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
/**

app/code/core/Mage/ImportExport/Model/Export.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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.')

app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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
{

app/code/core/Mage/ImportExport/Model/Import.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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
{

app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)