textmaster / akeneo-extension

Akeneo extension to translate via TextMaster.com
Other
2 stars 4 forks source link

Property Pim\Bundle\TextmasterBundle\Entity\Project::$code does not exist #43

Closed simoncarre closed 4 years ago

simoncarre commented 4 years ago

Hello,

I have just updated an Akeneo project from version 2.3 to 3.2.

I also updated the TextMaster bundle from version 2.4.1 to version 3.2.1. However, the bundle no longer seems functional and I have the following error in the logs:

request.CRITICAL: Uncaught PHP Exception ReflectionException: "Property Pim \ Bundle \ TextmasterBundle \ Entity \ Project :: $ code does not exist" at / srv / pim / vendor / doctrine / persistence / lib / Doctrine / Common / Persistence / Mapping / RuntimeReflectionService.php line 63 {"exception": "[object] (ReflectionException (code: 0): Property Pim \\ Bundle \\ TextmasterBundle \\ Entity \\ Project :: $ code does not exist at / srv / pim / vendor /doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php:63) "} []

Have you ever had this error?

Thank you in advance.

huynguyen93 commented 4 years ago

Hello,

From the error message, it looks like you haven't cleared the cache for doctrine mapping because Pim\Bundle\TextmasterBundle\Entity\Project::$code is only available in textmaster/akeneo-extension v2.3

Can you try to run: bin/console doctrine:cache:clear-metadata --env=dev bin/console doctrine:cache:clear-metadata --env=prod bin/console c:c --env=dev bin/console c:c --env=prod

To validate your current mapping, run: bin/console doctrine:schema:validate

Also, please note that the database schema for textmaster in 3.2 is very different from 2.3. So it will be easier if you can afford losing all your textmaster data.

Thanks

simoncarre commented 4 years ago

Hello,

Thank you for your response. I have run these commands:

php bin/console doctrine:cache:clear-metadata --env=prod
php bin/console cache:clear --env=prod

And run after : php bin/console doctrine:schema:validate --env=prod : capture_001

But I still have the same error in the logs (I can not used products grid and other features). My Akeneo version is EE 3.2.38. Bundle version installed is 3.2.3.

Do I have to clean up other data in the database to migrate from version 2.3? Do you have migration files?

Thank you.

huynguyen93 commented 4 years ago

It looks like you have good database setup now, it's weird you still have the error!

Would you mind to send me your composer.json & composer.lock file?

I will try to install on my machine, it might be easier...

Thank you.

huynguyen93 commented 4 years ago

Hello,

I have tried to upgrade akeneo extension from 3.0.3 to 3.2.3 and seen the error you have.

I ran the above commands and I restarted my docker, and the error is gone. My guess is it's some kind of cache that doctrine saves in memory.

Can you try to restart docker also?

Thanks

simoncarre commented 4 years ago

Hello @huynguyen93,

Thank you for your help. Yes, after docker container restart I have no longer error in logs :+1: However, I can not run this new bundle version...

I need to run an other command? No error in my logs...

huynguyen93 commented 4 years ago

Hello,

The reason you don't see any projects in database is because this command bin/console pim:textmaster:processing deletes the projects that don't have any documents.

From your image, I don't see any documents added (second row). You should select products that have translatable attributes (not empty) and the attributes are added in "System -> configuration -> TextMaster -> Settings -> Attributes"

Make sure you have documents added like this: Screenshot from 2020-02-27 09-57-31

After this, you should see projects created in table textmaster_project

Then, you need to have script bin/console pim:textmaster:processing running to actually synchronized projects in PIM and in TextMaster.

(The README.md file is also not updated, I'm sorry about that.)

simoncarre commented 4 years ago

Hello @huynguyen93,

Thanks I just changed the product and it actually works.

Thank you for your help!