Skip to content

Commit a50cda7

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #15136: [Backport] Add concrete type hints for product and category resources (by @rogyar) - #15129: Add missing false-check to the ConfiguredRegularPrice price-model (by @tkotosz) - #15173: Removed unused class declaration & code in comment (by @yogeshks) - #15162: Fixed js error when product has double quote in its name (by @vovayatsyuk)
2 parents ee59325 + 994c9ad commit a50cda7

File tree

6 files changed

+35
-6
lines changed

6 files changed

+35
-6
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
112112
*/
113113
protected $_url;
114114

115+
/**
116+
* @var ResourceModel\Category
117+
*/
118+
protected $_resource;
119+
115120
/**
116121
* URL rewrite model
117122
*
@@ -332,6 +337,16 @@ protected function getCustomAttributesCodes()
332337
return $this->customAttributesCodes;
333338
}
334339

340+
/**
341+
* @throws \Magento\Framework\Exception\LocalizedException
342+
* @return \Magento\Catalog\Model\ResourceModel\Category
343+
* @deprecated because resource models should be used directly
344+
*/
345+
protected function _getResource()
346+
{
347+
return parent::_getResource();
348+
}
349+
335350
/**
336351
* Get flat resource model flag
337352
*

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
118118
*/
119119
protected $_urlModel = null;
120120

121+
/**
122+
* @var ResourceModel\Product
123+
*/
124+
protected $_resource;
125+
121126
/**
122127
* @var string
123128
*/
@@ -482,6 +487,18 @@ protected function _construct()
482487
$this->_init(\Magento\Catalog\Model\ResourceModel\Product::class);
483488
}
484489

490+
/**
491+
* Get resource instance
492+
*
493+
* @throws \Magento\Framework\Exception\LocalizedException
494+
* @return \Magento\Catalog\Model\ResourceModel\Product
495+
* @deprecated because resource models should be used directly
496+
*/
497+
protected function _getResource()
498+
{
499+
return parent::_getResource();
500+
}
501+
485502
/**
486503
* Get a list of custom attribute codes that belongs to product attribute set. If attribute set not specified for
487504
* product will return all attribute codes

app/code/Magento/Catalog/Pricing/Price/ConfiguredRegularPrice.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public function setItem(ItemInterface $item)
7070
public function getValue()
7171
{
7272
$basePrice = parent::getValue();
73-
return $this->item
73+
74+
return ($this->item && $basePrice !== false)
7475
? $basePrice + $this->configuredOptions->getItemOptionsValue($basePrice, $this->item)
7576
: $basePrice;
7677
}

app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $viewModel = $block->getData('viewModel');
1111
"breadcrumbs": {
1212
"categoryUrlSuffix": "<?= $block->escapeHtml($viewModel->getCategoryUrlSuffix()); ?>",
1313
"useCategoryPathInUrl": <?= (int)$viewModel->isCategoryUsedInProductUrl(); ?>,
14-
"product": "<?= $block->escapeHtml($viewModel->getProductName()); ?>"
14+
"product": "<?= $block->escapeHtml($block->escapeJsQuote($viewModel->getProductName(), '"')); ?>"
1515
}
1616
}'>
1717
</div>

app/code/Magento/Review/view/frontend/templates/redirect.phtml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
?>
1010
<?php
11-
/* if(isset($GET['limit'])) {
12-
$limit = $GET['limit']
13-
}*/
1411
header("Location:{$block->getProduct()->getProductUrl()}#info-product_reviews");
1512
exit;
1613
?>

app/code/Magento/Version/Controller/Index/Index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Magento\Framework\App\Action\Action;
1010
use Magento\Framework\App\Action\Context;
1111
use Magento\Framework\App\ProductMetadataInterface;
12-
use Magento\Framework\Exception\StateException;
1312

1413
/**
1514
* Magento Version controller

0 commit comments

Comments
 (0)