Skip to content

Commit 8ea2d64

Browse files
committed
MC-16108: [Performance] EAV attribute is not cached
- Rename configuration path;
1 parent d0988c7 commit 8ea2d64

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class Config
3030
/**#@-*/
3131

3232
/**
33-
* Xml path to non user defined eav caching attributes configuration.
33+
* Xml path to caching user defined eav attributes configuration.
3434
*/
35-
private const XML_PATH_CACHE_NON_USER_DEFINED_ATTRIBUTES = 'dev/caching/cache_non_user_defined_attributes';
35+
private const XML_PATH_CACHE_USER_DEFINED_ATTRIBUTES = 'dev/caching/cache_user_defined_attributes';
3636

3737
/**#@-*/
3838
protected $_entityTypeData;
@@ -551,7 +551,7 @@ public function getAttribute($entityType, $code)
551551
return $this->attributes[$entityTypeCode][$code];
552552
}
553553

554-
if ($this->scopeConfig->getValue(self::XML_PATH_CACHE_NON_USER_DEFINED_ATTRIBUTES)) {
554+
if ($this->scopeConfig->getValue(self::XML_PATH_CACHE_USER_DEFINED_ATTRIBUTES)) {
555555
$cacheKey = self::ATTRIBUTES_CACHE_ID . '-attribute-' . $entityTypeCode . '-' . $code;
556556
$attributeData = $this->isCacheEnabled() && ($attribute = $this->_cache->load($cacheKey))
557557
? $this->serializer->unserialize($attribute)

app/code/Magento/Eav/etc/adminhtml/system.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<section id="dev">
1111
<group id="caching" translate="label" type="text" sortOrder="120" showInDefault="1" showInWebsite="0" showInStore="0">
1212
<label>Caching Settings</label>
13-
<field id="cache_non_user_defined_attributes" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
14-
<label>Cache Non User Defined Attributes</label>
13+
<field id="cache_user_defined_attributes" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
14+
<label>Cache User Defined Attributes</label>
1515
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1616
<comment>By default only system EAV attributes are cached.</comment>
1717
</field>

app/code/Magento/Eav/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</general>
2323
<dev>
2424
<caching>
25-
<cache_non_user_defined_attributes>0</cache_non_user_defined_attributes>
25+
<cache_user_defined_attributes>0</cache_user_defined_attributes>
2626
</caching>
2727
</dev>
2828
</default>

0 commit comments

Comments
 (0)