QuestionQ5

Catalog and Products

A company operates an Adobe Commerce store. An attribute called “my_attribute” (type “text”) was created to store every product’s global ID, which is shared across multiple systems.

Several months after go-live, all “my_attribute” values are integers. This creates an issue for the other systems when they receive this data.

An Adobe Commerce Architect must recommend a solution to change “my_attribute” from type “text” to “int”.

Which two actions should the Architect take to accomplish this?

Choose two
  • A Migrate data from table “catalog_product_entity_text” to “catalog_product_entity_int” for the attribute_id
  • B Go to Admin > Stores > Attributes > Product, edit “my_attribute” and update type from “text” to "int"
  • C Write a plugin for \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend::afterLoad() and load data from “catalog_product_entity_int”
  • D Create a Data Patch and update “my_attribute” type from “text” to “int”
  • E Run the command bin/magento indexer:reset catalog_product_attribute
Explanation

Product EAV values are persisted in backend tables determined by the attribute’s backend type; text values reside in the text backend table and integer values in the integer backend table. A Data Patch provides the version-controlled mechanism to update the attribute definition, while the existing rows for that attribute must be migrated from catalog_product_entity_text to catalog_product_entity_int so the values remain available after the backend type changes. Adobe’s documentation describes defining product attributes programmatically with a Data Patch and identifies catalog_product_entity_int as the integer attribute backend table.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!