Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom category attributes disappear on category save #664

Closed
pocallaghan opened this issue Mar 6, 2019 · 8 comments
Closed

Custom category attributes disappear on category save #664

pocallaghan opened this issue Mar 6, 2019 · 8 comments

Comments

@pocallaghan
Copy link

Preconditions

  1. Migrating from Magento 1.9.4.0 to Magento 2.3.0.
  2. Custom category attributes.

Steps to reproduce

  1. Add a custom attribute to a category in M1 (needs to be done in code, as there's no GUI capability for it).
  2. Migrate the store from M1 to M2.
  3. Save a category.

Expected result

  1. All attributes associated with the Category prior to saving should still be associated.

Actual result

  1. Upon save of a category, the attribute_set_id of the category is set to the default value (this happens in the Save controller), this is an attribute set called Default, rather than the attribute set it had before saving which was Migration_Default. Since the custom attributes migrated from M1 aren't associated with the new attribute set, those attributes are no longer loaded when the category is loaded.

Additional notes

Upon save the data for the attribute isn't lost, it's still in the database, it's just no longer loaded when the category is loaded because it filters on attribute_set_id.

@victor-v-rad
Copy link
Collaborator

Thank you @pocallaghan for reporting this issue and providing a good explanation. Internal ticket MAGETWO-98589 to fix it

@helmut-hoffer-von-ankershoffen

@victor-v-rad : Was there any progress and is there a workaround to make custom category attributes work after migration?

@victor-v-rad
Copy link
Collaborator

victor-v-rad commented Aug 26, 2019

Hi @helmuthva @pocallaghan
As a hot fix, you can change the value of default_attribute_set_id field in eav_entity_type table of Magento 2 DB to Migration_Default attribute set. Then clear cache and it should fix the issue with custom category attributes.

victor-v-rad added a commit that referenced this issue Sep 5, 2019
@helmut-hoffer-von-ankershoffen

@victor-v-rad : I can confirm the workaround worked.

@jesse-thomas
Copy link

Is this fixed in the data migration tool v2.3.3? I am having a similar issue.

@victor-v-rad
Copy link
Collaborator

yes this particular the issue was fixed in v2.3.3

@jesse-thomas
Copy link

jesse-thomas commented Oct 25, 2019

I wonder if I'm having the same issue or something else. I'm on 2.3.3/2.3.3 magento-ce/data migration tool.
After I run the migration I have to switch the default_attribute_set_id in eav_entity_type for categories to be able to save custom category attributes.
But it's just for one module's custom attributes (smile es), two other module's custom attributes are able to save and are included in the Migration_Default attribute set. All attributes are installed before migration, but the smile attributes are not migrated (could that be why they are not included in "Migration_Default").

Not trying to hijack this issue, just trying to track this down. Thanks for the reply!

@jesse-thomas
Copy link

Reverting the commit above causes the data migration to work as expected for me, allowing custom category attributes that only exist in M2 to be saved. ie sets the default_attribute_set_id to the attribute set with all the attributes.

Should Migrated_Default contain the M2 only attributes as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants