Skip to content

Commit

Permalink
PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano authored and MarcinNowakMacopedia committed Jun 13, 2023
1 parent c65054d commit 1fef326
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/code/core/Mage/Catalog/Model/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ protected function _refreshCategoryProductRewrites(Varien_Object $category)
$process = true;
$lastEntityId = 0;
$firstIteration = true;
while ($process == true) {
while ($process === true) {
$products = $this->getResource()->getProductsByCategory($category, $lastEntityId);
if (!$products) {
if ($firstIteration) {
Expand Down Expand Up @@ -463,7 +463,7 @@ public function refreshProductRewrite($productId, $storeId = null)
return $this;
}

$product = $this->getResource()->getProduct($productId, $storeId, $createForDisabled);
$product = $this->getResource()->getProduct($productId, $storeId);
if (!$product) {
// Product doesn't belong to this store - clear all its url rewrites including root one
$this->getResource()->clearProductRewrites($productId, $storeId, []);
Expand Down Expand Up @@ -497,7 +497,7 @@ public function refreshProductRewrite($productId, $storeId = null)
$excludeCategoryIds = array_keys($categories);

// Product is disabled and in configuration set to not create for disabled - clear all its url rewrites including root one
if (!$createForDisabled && $product->getStatus() === Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
if ($product->getStatus() === Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
$excludeCategoryIds = [];
}

Expand Down Expand Up @@ -985,10 +985,7 @@ protected function _saveRewriteHistory($rewriteData, $rewrite)
$rewriteData['options'] = 'RP'; // Redirect = Permanent
$this->getResource()->saveRewriteHistory($rewriteData);
}
$this->getResource()->clearProductRewrites($productId, $storeId, $excludeCategoryIds);

unset($categories);
unset($product);
$this->getResource()->clearProductRewrites($productId, $storeId);

return $this;
}
Expand Down

0 comments on commit 1fef326

Please sign in to comment.