Skip to content

Commit 2abab6d

Browse files
Merge remote-tracking branch 'origin/MC-35363' into 2.4-develop-pr35
2 parents 73d5535 + 70606e1 commit 2abab6d

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
8787
*
8888
* @var string
8989
*/
90-
protected $_cacheTag = self::CACHE_TAG;
90+
protected $_cacheTag = false;
9191

9292
/**
9393
* URL Model instance
@@ -1111,6 +1111,17 @@ public function afterSave()
11111111
return $result;
11121112
}
11131113

1114+
/**
1115+
* @inheritDoc
1116+
*/
1117+
public function getCacheTags()
1118+
{
1119+
$identities = $this->getIdentities();
1120+
$cacheTags = !empty($identities) ? (array) $identities : parent::getCacheTags();
1121+
1122+
return $cacheTags;
1123+
}
1124+
11141125
/**
11151126
* Init indexing process after category save
11161127
*

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Catalog\Api\ProductLinkRepositoryInterface;
1212
use Magento\Catalog\Model\Product\Attribute\Backend\Media\EntryConverterPool;
1313
use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface;
14-
use Magento\Catalog\Model\FilterProductCustomAttribute;
1514
use Magento\Framework\Api\AttributeValueFactory;
1615
use Magento\Framework\App\Filesystem\DirectoryList;
1716
use Magento\Framework\App\ObjectManager;
@@ -977,6 +976,17 @@ public function afterSave()
977976
return $result;
978977
}
979978

979+
/**
980+
* @inheritDoc
981+
*/
982+
public function getCacheTags()
983+
{
984+
$identities = $this->getIdentities();
985+
$cacheTags = !empty($identities) ? (array) $identities : parent::getCacheTags();
986+
987+
return $cacheTags;
988+
}
989+
980990
/**
981991
* Set quantity for product
982992
*
@@ -2158,7 +2168,7 @@ public function reset()
21582168
*/
21592169
public function getCacheIdTags()
21602170
{
2161-
// phpstan:ignore
2171+
// phpstan:ignore "Call to an undefined static method"
21622172
$tags = parent::getCacheIdTags();
21632173
$affectedCategoryIds = $this->getAffectedCategoryIds();
21642174
if (!$affectedCategoryIds) {
@@ -2339,7 +2349,8 @@ public function isDisabled()
23392349
public function getImage()
23402350
{
23412351
$this->getTypeInstance()->setImageFromChildProduct($this);
2342-
// phpstan:ignore
2352+
2353+
// phpstan:ignore "Call to an undefined static method"
23432354
return parent::getImage();
23442355
}
23452356

@@ -2403,6 +2414,8 @@ public function reloadPriceInfo()
24032414
}
24042415
}
24052416

2417+
//phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore
2418+
24062419
/**
24072420
* Return Data Object data in array format.
24082421
*
@@ -2430,6 +2443,8 @@ public function __toArray() //phpcs:ignore PHPCompatibility.FunctionNameRestrict
24302443
return $data;
24312444
}
24322445

2446+
//phpcs:enable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore
2447+
24332448
/**
24342449
* Convert Category model into flat array.
24352450
*

app/code/Magento/Catalog/etc/frontend/di.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
</argument>
1414
</arguments>
1515
</virtualType>
16-
<type name="Magento\Catalog\Model\ResourceModel\Category\Collection">
17-
<arguments>
18-
<argument name="fetchStrategy" xsi:type="object">Magento\Catalog\Model\ResourceModel\Category\Collection\FetchStrategy</argument>
19-
</arguments>
20-
</type>
2116
<type name="Magento\Catalog\Model\Indexer\AbstractFlatState">
2217
<arguments>
2318
<argument name="isAvailable" xsi:type="boolean">true</argument>

0 commit comments

Comments
 (0)