tzyganu / UMC1.9

New Ultimate Module Creator for Magento 1.7 +
MIT License
242 stars 88 forks source link

product->entity relation not saved #138

Open arosenhagen opened 6 years ago

arosenhagen commented 6 years ago

I've created an extension with one entity and a relation to a product.

  1. When saving the product with a newly assigned entity the relation doesn't show up on the entity edit page under "Associated Products".
  2. When saving the entity with an "Associated Product" the relation show up on the product detail page in the corresponding attribute dropdown.

Anything I'm missing here?

tzyganu commented 6 years ago

@arosenhagen Please send me the generated extension file at ultimate.module.creator@gmail.com THe file should be in var/modulecreator/package and it should be named as your module Namespace_Module.xml.
This will help me recreate your extension on my side and see what's wrong.
And sorry for the late response. I'm overbooked for now. Will try to answer as fast as I can.

arosenhagen commented 6 years ago

no problem :-) I found the issue by myself. The thing is, that the generation with UMC doesn't include the logic that properly saves the relationship between product and product-attribute (and vice versa). Especially public function save{{Entity}}Relation(${{entity}}, $data)was problematic in that the product attribute wasn't set when saving the entity. I solved it by manually call Mage::getSingleton('catalog/product_action')->updateAttributes(...)in this function.