akeneo / transporteo

Migration Tool for Akeneo PIM from 1.7 to 2.0
Other
8 stars 7 forks source link

Fix issue #125: Potential exception on Reference Data migration #144

Closed bpresles closed 6 years ago

bpresles commented 6 years ago

Because Transporteo doesn't set named key on the "reference-data" table, the generated configuration for reference datas is invalid according to "bin/console pim:reference-data:check --env=prod" command: ""

Indeed, the reference-data config is generated as follow:

pim_reference_data:  
    assets:
        class: PimEnterprise\Component\ProductAsset\Model\Asset
        type: multi
    0:
        class: [fully qualified class name]
        type: [type]

While it should be:

pim_reference_data:
    assets:
        class: PimEnterprise\Component\ProductAsset\Model\Asset
        type: multi
    [entityMachineName]:
        class: [fully qualified class name]
        type: [type]

Resulting that the entities aren't configured properly and a InvalidArgumentException with message "The entity [fully qualified class name] is not configured"

Also sometimes the check using 'doctrine:mapping:info' command (on AntityMappingChecker class) doesn't list the newly injected (on the configuration) entity reference data, because of the cache and also make the migration fails with a InvalidArgumentException "The entity [fully qualified class name] is not configured"

To avoid that case I added a call to cache:clear before doctrine:mapping:info check, so that the mapping info is always up to date when the check is performed.

Related issue: https://github.com/akeneo/transporteo/issues/125

Definition Of Done

Q A
Added Specs Todo
Review and 2 GTM Todo
Micro Demo to the PO (Story only) Todo

Todo: Pending / Work in progress OK: Done / Validated -: Not needed

anaelChardan commented 6 years ago

Thanks for you contribution!