Skip to content

Commit 2a8a96a

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #13174: Fix: remove TestObserver class (by @coderimus) - #13155: Optimization: module-sales is_null change to strict comparison instead (by @coderimus) - #13171: Optimization: magento/module-catalog is_null change to strict comparison (by @coderimus) - #13170: Optimization: magento/module-tax is_null change to strict comparison (by @coderimus) - #13169: Optimization: magento/module-eav is_null change to strict comparison … (by @coderimus) - magento-engcom/magento2ce#1216: #8453: [GitHub] Price outlining in Invoice PDF (by @serhii-balko) - #12990: [2.2.x] Fix undeclared dependency magento/zendframework1 by magento/framework (by @ihor-sviziev) - #12998: Make customer name link to customer dashboard (by @srenon) - #13086: Add failsafe to items.phtml (by @samgranger) - #13066: Fix for #12877 as per @azeemism (by @jagritijoshi) - #13033: Newsletter\Model\Subscriber::loadByEmail() does not use MySQL index (by @devamitbera) - magento-engcom/magento2ce#1032: #8114: "Save Block"-button on Add New Block silently ignores clicks if the content is empty. (by @RomaKis) Fixed GitHub Issues: - #8453: Price outlining in Invoice PDF (reported by @joost-florijn-kega) has been fixed in magento-engcom/magento2ce#1216 by @serhii-balko in 2.2-develop branch Related commits: 1. 21566e8 - #12967: Undeclared dependency magento/zendframework1 by magento/framework (reported by @linden2015) has been fixed in #12990 by @ihor-sviziev in 2.2-develop branch Related commits: 1. df2c8fd - #12877: [2.2.1] Magento Database Backup Command Fails (Fix included) (reported by @azeemism) has been fixed in #13066 by @jagritijoshi in 2.2-develop branch Related commits: 1. bc434c1 - #12787: Newsletter\Model\Subscriber::loadByEmail() does not use MySQL index (reported by @schmengler) has been fixed in #13033 by @devamitbera in 2.2-develop branch Related commits: 1. 7559783 2. b853497 3. be8b258 - #8114: "Save Block"-button on Add New Block silently ignores clicks if the content is empty. (reported by @geon) has been fixed in magento-engcom/magento2ce#1032 by @RomaKis in 2.2-develop branch Related commits: 1. 5bac54f 2. 4456872 3. 42ee7cc
2 parents 8b64f6b + 1a3c281 commit 2a8a96a

31 files changed

Lines changed: 107 additions & 89 deletions

File tree

app/code/Magento/Backup/Model/Db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu
154154

155155
if ($tableStatus->getDataLength() > self::BUFFER_LENGTH) {
156156
if ($tableStatus->getAvgRowLength() < self::BUFFER_LENGTH) {
157-
$limit = floor(self::BUFFER_LENGTH / $tableStatus->getAvgRowLength());
157+
$limit = floor(self::BUFFER_LENGTH / max($tableStatus->getAvgRowLength(), 1));
158158
$multiRowsLength = ceil($tableStatus->getRows() / $limit);
159159
} else {
160160
$limit = 1;

app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function getStoreSwitcherHtml()
228228
public function getLoadTreeUrl($expanded = null)
229229
{
230230
$params = ['_current' => true, 'id' => null, 'store' => null];
231-
if (is_null($expanded) && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
231+
if ($expanded === null && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
232232
$params['expand_all'] = true;
233233
}
234234
return $this->getUrl('*/*/categoriesJson', $params);

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ public function getOptionValues()
313313
$value['checkboxScopeTitle'] = $this->getCheckboxScopeHtml(
314314
$option->getOptionId(),
315315
'title',
316-
is_null($option->getStoreTitle())
316+
$option->getStoreTitle() === null
317317
);
318-
$value['scopeTitleDisabled'] = is_null($option->getStoreTitle()) ? 'disabled' : null;
318+
$value['scopeTitleDisabled'] = $option->getStoreTitle() === null ? 'disabled' : null;
319319
}
320320

321321
if ($option->getGroupByType() == ProductCustomOptionInterface::OPTION_GROUP_SELECT) {
@@ -341,22 +341,22 @@ public function getOptionValues()
341341
$value['optionValues'][$i]['checkboxScopeTitle'] = $this->getCheckboxScopeHtml(
342342
$_value->getOptionId(),
343343
'title',
344-
is_null($_value->getStoreTitle()),
344+
$_value->getStoreTitle() === null,
345345
$_value->getOptionTypeId()
346346
);
347-
$value['optionValues'][$i]['scopeTitleDisabled'] = is_null(
348-
$_value->getStoreTitle()
347+
$value['optionValues'][$i]['scopeTitleDisabled'] = (
348+
$_value->getStoreTitle() === null
349349
) ? 'disabled' : null;
350350
if ($scope == \Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE) {
351351
$value['optionValues'][$i]['checkboxScopePrice'] = $this->getCheckboxScopeHtml(
352352
$_value->getOptionId(),
353353
'price',
354-
is_null($_value->getstorePrice()),
354+
$_value->getstorePrice() === null,
355355
$_value->getOptionTypeId(),
356356
['$(this).up(1).previous()']
357357
);
358-
$value['optionValues'][$i]['scopePriceDisabled'] = is_null(
359-
$_value->getStorePrice()
358+
$value['optionValues'][$i]['scopePriceDisabled'] = (
359+
$_value->getStorePrice() === null
360360
) ? 'disabled' : null;
361361
}
362362
}
@@ -379,9 +379,9 @@ public function getOptionValues()
379379
$value['checkboxScopePrice'] = $this->getCheckboxScopeHtml(
380380
$option->getOptionId(),
381381
'price',
382-
is_null($option->getStorePrice())
382+
$option->getStorePrice() === null
383383
);
384-
$value['scopePriceDisabled'] = is_null($option->getStorePrice()) ? 'disabled' : null;
384+
$value['scopePriceDisabled'] = $option->getStorePrice() === null ? 'disabled' : null;
385385
}
386386
}
387387
$values[] = new \Magento\Framework\DataObject($value);

app/code/Magento/Catalog/Block/Product/ProductList/Related.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function getItems()
121121
* getIdentities() depends on _itemCollection populated, but it can be empty if the block is hidden
122122
* @see https://github.com/magento/magento2/issues/5897
123123
*/
124-
if (is_null($this->_itemCollection)) {
124+
if ($this->_itemCollection === null) {
125125
$this->_prepareData();
126126
}
127127
return $this->_itemCollection;

app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function getItemCollection()
140140
* getIdentities() depends on _itemCollection populated, but it can be empty if the block is hidden
141141
* @see https://github.com/magento/magento2/issues/5897
142142
*/
143-
if (is_null($this->_itemCollection)) {
143+
if ($this->_itemCollection === null) {
144144
$this->_prepareData();
145145
}
146146
return $this->_itemCollection;
@@ -151,7 +151,7 @@ public function getItemCollection()
151151
*/
152152
public function getItems()
153153
{
154-
if (is_null($this->_items)) {
154+
if ($this->_items === null) {
155155
$this->_items = $this->getItemCollection()->getItems();
156156
}
157157
return $this->_items;

app/code/Magento/Catalog/Model/Config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ public function getSourceOptionId($source, $value)
407407
*/
408408
public function getProductAttributes()
409409
{
410-
if (is_null($this->_productAttributes)) {
410+
if ($this->_productAttributes === null) {
411411
$this->_productAttributes = array_keys($this->getAttributesUsedInProductListing());
412412
}
413413
return $this->_productAttributes;
@@ -430,7 +430,7 @@ protected function _getResource()
430430
*/
431431
public function getAttributesUsedInProductListing()
432432
{
433-
if (is_null($this->_usedInProductListing)) {
433+
if ($this->_usedInProductListing === null) {
434434
$this->_usedInProductListing = [];
435435
$entityType = \Magento\Catalog\Model\Product::ENTITY;
436436
$attributesData = $this->_getResource()->setStoreId($this->getStoreId())->getAttributesUsedInListing();
@@ -453,7 +453,7 @@ public function getAttributesUsedInProductListing()
453453
*/
454454
public function getAttributesUsedForSortBy()
455455
{
456-
if (is_null($this->_usedForSortBy)) {
456+
if ($this->_usedForSortBy === null) {
457457
$this->_usedForSortBy = [];
458458
$entityType = \Magento\Catalog\Model\Product::ENTITY;
459459
$attributesData = $this->_getResource()->getAttributesUsedForSortBy();

app/code/Magento/Catalog/Model/Layer/Filter/Price.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function apply(\Magento\Framework\App\RequestInterface $request)
150150
public function getCustomerGroupId()
151151
{
152152
$customerGroupId = $this->_getData('customer_group_id');
153-
if (is_null($customerGroupId)) {
153+
if ($customerGroupId === null) {
154154
$customerGroupId = $this->_customerSession->getCustomerGroupId();
155155
}
156156

@@ -176,7 +176,7 @@ public function setCustomerGroupId($customerGroupId)
176176
public function getCurrencyRate()
177177
{
178178
$rate = $this->_getData('currency_rate');
179-
if (is_null($rate)) {
179+
if ($rate === null) {
180180
$rate = $this->_storeManager->getStore($this->getStoreId())
181181
->getCurrentCurrencyRate();
182182
}

app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function __construct(
9191
*/
9292
protected function _getWebsiteCurrencyRates()
9393
{
94-
if (is_null($this->_rates)) {
94+
if ($this->_rates === null) {
9595
$this->_rates = [];
9696
$baseCurrency = $this->_config->getValue(
9797
\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE,

app/code/Magento/Catalog/Model/Product/Option/Value.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function setProduct($product)
179179
*/
180180
public function getProduct()
181181
{
182-
if (is_null($this->_product)) {
182+
if ($this->_product === null) {
183183
$this->_product = $this->getOption()->getProduct();
184184
}
185185
return $this->_product;

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ public function getSelectCountSql()
10921092
protected function _getSelectCountSql($select = null, $resetLeftJoins = true)
10931093
{
10941094
$this->_renderFilters();
1095-
$countSelect = is_null($select) ? $this->_getClearSelect() : $this->_buildClearSelect($select);
1095+
$countSelect = $select === null ? $this->_getClearSelect() : $this->_buildClearSelect($select);
10961096
$countSelect->columns('COUNT(DISTINCT e.entity_id)');
10971097
if ($resetLeftJoins) {
10981098
$countSelect->resetJoinLeft();
@@ -1435,7 +1435,7 @@ public function getAllIdsCache($resetCache = false)
14351435
$ids = $this->_allIdsCache;
14361436
}
14371437

1438-
if (is_null($ids)) {
1438+
if ($ids === null) {
14391439
$ids = $this->getAllIds();
14401440
$this->setAllIdsCache($ids);
14411441
}
@@ -1466,17 +1466,17 @@ public function addPriceData($customerGroupId = null, $websiteId = null)
14661466
{
14671467
$this->_productLimitationFilters->setUsePriceIndex(true);
14681468

1469-
if (!isset($this->_productLimitationFilters['customer_group_id']) && is_null($customerGroupId)) {
1469+
if (!isset($this->_productLimitationFilters['customer_group_id']) && $customerGroupId === null) {
14701470
$customerGroupId = $this->_customerSession->getCustomerGroupId();
14711471
}
1472-
if (!isset($this->_productLimitationFilters['website_id']) && is_null($websiteId)) {
1472+
if (!isset($this->_productLimitationFilters['website_id']) && $websiteId === null) {
14731473
$websiteId = $this->_storeManager->getStore($this->getStoreId())->getWebsiteId();
14741474
}
14751475

1476-
if (!is_null($customerGroupId)) {
1476+
if ($customerGroupId !== null) {
14771477
$this->_productLimitationFilters['customer_group_id'] = $customerGroupId;
14781478
}
1479-
if (!is_null($websiteId)) {
1479+
if ($websiteId !== null) {
14801480
$this->_productLimitationFilters['website_id'] = $websiteId;
14811481
}
14821482

@@ -2347,7 +2347,7 @@ public function setOrder($attribute, $dir = Select::SQL_DESC)
23472347
*/
23482348
public function getMaxPrice()
23492349
{
2350-
if (is_null($this->_maxPrice)) {
2350+
if ($this->_maxPrice === null) {
23512351
$this->_prepareStatisticsData();
23522352
}
23532353

@@ -2361,7 +2361,7 @@ public function getMaxPrice()
23612361
*/
23622362
public function getMinPrice()
23632363
{
2364-
if (is_null($this->_minPrice)) {
2364+
if ($this->_minPrice === null) {
23652365
$this->_prepareStatisticsData();
23662366
}
23672367

@@ -2375,7 +2375,7 @@ public function getMinPrice()
23752375
*/
23762376
public function getPriceStandardDeviation()
23772377
{
2378-
if (is_null($this->_priceStandardDeviation)) {
2378+
if ($this->_priceStandardDeviation === null) {
23792379
$this->_prepareStatisticsData();
23802380
}
23812381

@@ -2389,7 +2389,7 @@ public function getPriceStandardDeviation()
23892389
*/
23902390
public function getPricesCount()
23912391
{
2392-
if (is_null($this->_pricesCount)) {
2392+
if ($this->_pricesCount === null) {
23932393
$this->_prepareStatisticsData();
23942394
}
23952395

0 commit comments

Comments
 (0)