Skip to content

Commit fa7496a

Browse files
committed
MC-16108: EAV attribute is not cached
- Define eav attributes per modules;
1 parent 8ea2d64 commit fa7496a

File tree

8 files changed

+76
-38
lines changed

8 files changed

+76
-38
lines changed

app/code/Magento/Bundle/etc/di.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,17 @@
221221
</argument>
222222
</arguments>
223223
</type>
224+
<type name="Magento\Eav\Model\Config">
225+
<arguments>
226+
<argument name="attributesForPreload" xsi:type="array">
227+
<item name="catalog_product" xsi:type="array">
228+
<item name="price_type" xsi:type="string">catalog_product</item>
229+
<item name="price_view" xsi:type="string">catalog_product</item>
230+
<item name="shipment_type" xsi:type="string">catalog_product</item>
231+
<item name="sku_type" xsi:type="string">catalog_product</item>
232+
<item name="weight_type" xsi:type="string">catalog_product</item>
233+
</item>
234+
</argument>
235+
</arguments>
236+
</type>
224237
</config>

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

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,6 @@
11801180
<arguments>
11811181
<argument name="attributesForPreload" xsi:type="array">
11821182
<item name="catalog_product" xsi:type="array">
1183-
<item name="allow_message" xsi:type="string">catalog_product</item>
1184-
<item name="allow_open_amount" xsi:type="string">catalog_product</item>
11851183
<item name="category_ids" xsi:type="string">catalog_product</item>
11861184
<item name="country_of_manufacture" xsi:type="string">catalog_product</item>
11871185
<item name="created_at" xsi:type="string">catalog_product</item>
@@ -1191,72 +1189,39 @@
11911189
<item name="custom_layout" xsi:type="string">catalog_product</item>
11921190
<item name="custom_layout_update" xsi:type="string">catalog_product</item>
11931191
<item name="description" xsi:type="string">catalog_product</item>
1194-
<item name="email_template" xsi:type="string">catalog_product</item>
11951192
<item name="gallery" xsi:type="string">catalog_product</item>
1196-
<item name="giftcard_amounts" xsi:type="string">catalog_product</item>
1197-
<item name="giftcard_type" xsi:type="string">catalog_product</item>
1198-
<item name="gift_message_available" xsi:type="string">catalog_product</item>
1199-
<item name="gift_wrapping_available" xsi:type="string">catalog_product</item>
1200-
<item name="gift_wrapping_price" xsi:type="string">catalog_product</item>
12011193
<item name="has_options" xsi:type="string">catalog_product</item>
12021194
<item name="image" xsi:type="string">catalog_product</item>
12031195
<item name="image_label" xsi:type="string">catalog_product</item>
1204-
<item name="is_redeemable" xsi:type="string">catalog_product</item>
12051196
<item name="is_returnable" xsi:type="string">catalog_product</item>
1206-
<item name="lifetime" xsi:type="string">catalog_product</item>
1207-
<item name="links_exist" xsi:type="string">catalog_product</item>
1208-
<item name="links_purchased_separately" xsi:type="string">catalog_product</item>
1209-
<item name="links_title" xsi:type="string">catalog_product</item>
12101197
<item name="media_gallery" xsi:type="string">catalog_product</item>
12111198
<item name="meta_description" xsi:type="string">catalog_product</item>
12121199
<item name="meta_keyword" xsi:type="string">catalog_product</item>
12131200
<item name="meta_title" xsi:type="string">catalog_product</item>
12141201
<item name="minimal_price" xsi:type="string">catalog_product</item>
1215-
<item name="msrp" xsi:type="string">catalog_product</item>
1216-
<item name="msrp_display_actual_price_type" xsi:type="string">catalog_product</item>
12171202
<item name="name" xsi:type="string">catalog_product</item>
12181203
<item name="news_from_date" xsi:type="string">catalog_product</item>
12191204
<item name="news_to_date" xsi:type="string">catalog_product</item>
12201205
<item name="old_id" xsi:type="string">catalog_product</item>
1221-
<item name="open_amount_max" xsi:type="string">catalog_product</item>
1222-
<item name="open_amount_min" xsi:type="string">catalog_product</item>
12231206
<item name="options_container" xsi:type="string">catalog_product</item>
12241207
<item name="page_layout" xsi:type="string">catalog_product</item>
12251208
<item name="price" xsi:type="string">catalog_product</item>
1226-
<item name="price_type" xsi:type="string">catalog_product</item>
1227-
<item name="price_view" xsi:type="string">catalog_product</item>
12281209
<item name="quantity_and_stock_status" xsi:type="string">catalog_product</item>
1229-
<item name="related_tgtr_position_behavior" xsi:type="string">catalog_product</item>
1230-
<item name="related_tgtr_position_limit" xsi:type="string">catalog_product</item>
12311210
<item name="required_options" xsi:type="string">catalog_product</item>
1232-
<item name="samples_title" xsi:type="string">catalog_product</item>
1233-
<item name="shipment_type" xsi:type="string">catalog_product</item>
12341211
<item name="short_description" xsi:type="string">catalog_product</item>
12351212
<item name="sku" xsi:type="string">catalog_product</item>
1236-
<item name="sku_type" xsi:type="string">catalog_product</item>
12371213
<item name="small_image" xsi:type="string">catalog_product</item>
12381214
<item name="small_image_label" xsi:type="string">catalog_product</item>
12391215
<item name="special_from_date" xsi:type="string">catalog_product</item>
12401216
<item name="special_price" xsi:type="string">catalog_product</item>
12411217
<item name="special_to_date" xsi:type="string">catalog_product</item>
12421218
<item name="status" xsi:type="string">catalog_product</item>
1243-
<item name="swatch_image" xsi:type="string">catalog_product</item>
1244-
<item name="tax_class_id" xsi:type="string">catalog_product</item>
12451219
<item name="thumbnail" xsi:type="string">catalog_product</item>
12461220
<item name="thumbnail_label" xsi:type="string">catalog_product</item>
12471221
<item name="tier_price" xsi:type="string">catalog_product</item>
12481222
<item name="updated_at" xsi:type="string">catalog_product</item>
1249-
<item name="upsell_tgtr_position_behavior" xsi:type="string">catalog_product</item>
1250-
<item name="upsell_tgtr_position_limit" xsi:type="string">catalog_product</item>
1251-
<item name="url_key" xsi:type="string">catalog_product</item>
1252-
<item name="url_path" xsi:type="string">catalog_product</item>
1253-
<item name="use_config_allow_message" xsi:type="string">catalog_product</item>
1254-
<item name="use_config_email_template" xsi:type="string">catalog_product</item>
1255-
<item name="use_config_is_redeemable" xsi:type="string">catalog_product</item>
1256-
<item name="use_config_lifetime" xsi:type="string">catalog_product</item>
12571223
<item name="visibility" xsi:type="string">catalog_product</item>
12581224
<item name="weight" xsi:type="string">catalog_product</item>
1259-
<item name="weight_type" xsi:type="string">catalog_product</item>
12601225
</item>
12611226
<item name="catalog_category" xsi:type="array">
12621227
<item name="all_children" xsi:type="string">catalog_category</item>
@@ -1284,12 +1249,9 @@
12841249
<item name="meta_title" xsi:type="string">catalog_category</item>
12851250
<item name="name" xsi:type="string">catalog_category</item>
12861251
<item name="page_layout" xsi:type="string">catalog_category</item>
1287-
<item name="name" xsi:type="string">catalog_category</item>
12881252
<item name="path" xsi:type="string">catalog_category</item>
12891253
<item name="path_in_store" xsi:type="string">catalog_category</item>
12901254
<item name="position" xsi:type="string">catalog_category</item>
1291-
<item name="url_key" xsi:type="string">catalog_category</item>
1292-
<item name="url_path" xsi:type="string">catalog_category</item>
12931255
</item>
12941256
</argument>
12951257
</arguments>

app/code/Magento/CatalogUrlRewrite/etc/di.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,18 @@
5656
</argument>
5757
</arguments>
5858
</type>
59+
<type name="Magento\Eav\Model\Config">
60+
<arguments>
61+
<argument name="attributesForPreload" xsi:type="array">
62+
<item name="catalog_product" xsi:type="array">
63+
<item name="url_key" xsi:type="string">catalog_product</item>
64+
<item name="url_path" xsi:type="string">catalog_product</item>
65+
</item>
66+
<item name="catalog_category" xsi:type="array">
67+
<item name="url_key" xsi:type="string">catalog_category</item>
68+
<item name="url_path" xsi:type="string">catalog_category</item>
69+
</item>
70+
</argument>
71+
</arguments>
72+
</type>
5973
</config>

app/code/Magento/Downloadable/etc/di.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,16 @@
174174
</argument>
175175
</arguments>
176176
</type>
177+
<type name="Magento\Eav\Model\Config">
178+
<arguments>
179+
<argument name="attributesForPreload" xsi:type="array">
180+
<item name="catalog_product" xsi:type="array">
181+
<item name="links_exist" xsi:type="string">catalog_product</item>
182+
<item name="links_purchased_separately" xsi:type="string">catalog_product</item>
183+
<item name="links_title" xsi:type="string">catalog_product</item>
184+
<item name="samples_title" xsi:type="string">catalog_product</item>
185+
</item>
186+
</argument>
187+
</arguments>
188+
</type>
177189
</config>

app/code/Magento/GiftMessage/etc/di.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,13 @@
2828
<plugin name="save_gift_message" type="Magento\GiftMessage\Model\Plugin\OrderSave"/>
2929
<plugin name="get_gift_message" type="Magento\GiftMessage\Model\Plugin\OrderGet"/>
3030
</type>
31+
<type name="Magento\Eav\Model\Config">
32+
<arguments>
33+
<argument name="attributesForPreload" xsi:type="array">
34+
<item name="catalog_product" xsi:type="array">
35+
<item name="gift_message_available" xsi:type="string">catalog_product</item>
36+
</item>
37+
</argument>
38+
</arguments>
39+
</type>
3140
</config>

app/code/Magento/Msrp/etc/di.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,14 @@
5353
</argument>
5454
</arguments>
5555
</type>
56+
<type name="Magento\Eav\Model\Config">
57+
<arguments>
58+
<argument name="attributesForPreload" xsi:type="array">
59+
<item name="catalog_product" xsi:type="array">
60+
<item name="msrp" xsi:type="string">catalog_product</item>
61+
<item name="msrp_display_actual_price_type" xsi:type="string">catalog_product</item>
62+
</item>
63+
</argument>
64+
</arguments>
65+
</type>
5666
</config>

app/code/Magento/Swatches/etc/di.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,13 @@
8484
<type name="Magento\Catalog\Model\Product\Attribute\OptionManagement">
8585
<plugin name="swatches_product_attribute_optionmanagement_plugin" type="Magento\Swatches\Plugin\Eav\Model\Entity\Attribute\OptionManagement"/>
8686
</type>
87+
<type name="Magento\Eav\Model\Config">
88+
<arguments>
89+
<argument name="attributesForPreload" xsi:type="array">
90+
<item name="catalog_product" xsi:type="array">
91+
<item name="swatch_image" xsi:type="string">catalog_product</item>
92+
</item>
93+
</argument>
94+
</arguments>
95+
</type>
8796
</config>

app/code/Magento/Tax/etc/di.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,13 @@
183183
<type name="Magento\Catalog\Ui\DataProvider\Product\Listing\DataProvider">
184184
<plugin name="taxSettingsProvider" type="Magento\Tax\Plugin\Ui\DataProvider\TaxSettings"/>
185185
</type>
186+
<type name="Magento\Eav\Model\Config">
187+
<arguments>
188+
<argument name="attributesForPreload" xsi:type="array">
189+
<item name="catalog_product" xsi:type="array">
190+
<item name="tax_class_id" xsi:type="string">catalog_product</item>
191+
</item>
192+
</argument>
193+
</arguments>
194+
</type>
186195
</config>

0 commit comments

Comments
 (0)