Closed igormukhingmailcom closed 8 years ago
Same problems here. What i get after recreating the database is the following schema:
I guess it should be only one table with a "self-reference" (like the old pim_catalog_category has got).
Within the import job the generated query SELECT t1.id AS id2, t1.code AS code3, t1.created AS created4, t1.root AS root5, t1.lvl AS lvl6, t1.lft AS lft7, t1.rgt AS rgt8, t1.description AS description9, t1.parent_id AS parent_id10 FROM MyCategory t1 WHERE t0.code = ? LIMIT 1
is causing the exception from above (its generated in BasicEntityPersister.php/load(...)).
@julmuell Yes, have exactly same tables structure, without parent_id on custom table. WDYT, this is Doctrine issue?
Hello guys,
Did you override the orm mapping ? You should have this:
Application\PimCatalogBundle\Entity\Category:
type: entity
table: pim_catalog_category
fields:
description:
type: text
nullable: true
And added this key to the DI:
parameters:
pim_catalog.entity.category.class: Application\PimCatalogBundle\Entity\Category
Regards
Hi, @juliensnz. Yes, sure. With no result. I've resolve this issue by fully copy-pasting parent entity and adding new fields right into copied one - so I've got a big file with lot of fields :). After this I have two tables (new one and parent one that not using anymore), but it at least working...
Hi @igormukhingmailcom and @julmuell !
You're right, there is an issue in the 1.4 documentation, thank you very much for the feedback!
We've fixed the doc in this Pull Request https://github.com/akeneo/pim-docs/pull/190/files (we'll deploy it soon on our official doc).
The missing part is the following one:
+You also need to configure the mapping override in your application configuration (to avoid to copy/paste the whole parent class mapping):
+
+.. code-block:: yaml
+
+ # app/config/config.yml
+ akeneo_storage_utils:
+ mapping_overrides:
+ -
+ original: Pim\Bundle\CatalogBundle\Entity\Category
+ override: Acme\Bundle\AppBundle\Entity\Category
This part configures the automatic copy/paste of parent class mapping.
We've enhanced it in 1.4 by introducing the mapping_overrides configuration, we've properly updated the cookbook http://docs.akeneo.com/latest/cookbook/catalog_structure/overriding_the_orm_product_value.html but we've missed this conf in the category override cookbook.
BTW, if you encounter any typo or issues with the doc, do not hesitate to open a Pull Request to contribute on https://github.com/akeneo/pim-docs
Please let me know if it solves your issue, thx! :)
Hi, @nidup! Thank you very much :)
Hi.
I've added new fields via overriding Category entity as described here: http://docs.akeneo.com/master/cookbook/category/add-properties-to-category.html
But when I trying to run
pim:install
- I have next result:Entity
CustomCategory
overridesCategory
right way, but fieldparent_id
not in database for unexpected reason, onlyid, code, created, root, lvl, lft, rgt
and my custom fields there.Can anyone help me, please? Thanks.