QuestionQ22

Working with Databases and EAV

An Adobe Commerce Developer has created an importer and exporter for a custom entity. The client uses them to modify exported data and then re-import the file to batch-update the entities.

A text attribute, media_gallery, contains imagery-related information in JSON form. The client does not want to change this field, but the software used to edit the exported data appears to modify it, preventing a successful import.

How should the developer prevent this?

Explanation

Adding media_gallery to the exporter's $_disabledAttrs array excludes that attribute from the exported data. The editing software therefore cannot alter its JSON value, and the subsequent batch import does not receive a corrupted media_gallery field.

Community Discussion

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