-
Notifications
You must be signed in to change notification settings - Fork 61
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
GitHub 144 localizable custom entities #148
base: master
Are you sure you want to change the base?
GitHub 144 localizable custom entities #148
Conversation
Wow thank you so much @kanduvisla We will take care of your PR as soon as possible. Cheers, |
This worked for me, thanks for sharing. However the denormalization part may be in conflict with the fixed issue #167 |
Hello, I'm currently using translatable entities. Thanks for this commit. Will this PR merged soon ? |
$translation->setLabel($value); | ||
|
||
if ($this->propertyAccessor->isWritable($translation, $propertyPath)) { | ||
$this->propertyAccessor->setValue($translation, $propertyPath, $value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't work for labels due to the final "S"
@@ -48,13 +47,38 @@ public function process($item) | |||
continue; | |||
} | |||
|
|||
$value = $this->propertyAccessor->getValue($item, $property->getName()); | |||
$normalizedData[$property->getName()] = $this->normalizer->normalize($value, 'flat'); | |||
$value = $this->normalizer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug :
provokes an error
An error occurred during the export execution.
> Error #0 in class Doctrine\Common\Persistence\Mapping\MappingException: The class 'Doctrine\ORM\PersistentCollection' was not found in the chain configured name
> spaces Gedmo\Tree\Entity, Oro\Bundle\ConfigBundle\Entity, Oro\Bundle\UserBundle\Entity, Pim\Bundle\CustomEntityBundle\Entity, FOS\OAuthServerBundle\Entity, Pim\
> Bundle\UserBundle\Entity, Pim\Bundle\ApiBundle\Entity, Pim\Bundle\CatalogBundle\Entity, Pim\Bundle\CommentBundle\Entity, Pim\Bundle\DataGridBundle\Entity, Pim\B
> undle\NotificationBundle\Entity, Amepim\Bundle\CatalogBundle\Entity, Amepim\Bundle\CustomEntityBundle\Entity, Amepim\Bundle\DeletedEntityBundle\Entity, Akeneo\C
> omponent\Batch\Model, Akeneo\Component\BatchQueue\Queue, Akeneo\Component\FileStorage\Model, Pim\Component\Catalog\Model, Akeneo\Component\Versioning\Model
This PR is a follow-up for GitHub issue #144.
I made some additions so the Custom Entity Bundle can properly handle localizable custom entities. I still want to add some unit tests and example code (or update the existing example module), but it would already be great if I could get some feedback if I'm on the right track.
Any feedback is welcome!