You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First time I use DoctrineBehaviors. I would highly appreciate a bit of automatism for translation handling.
I noticed that after flush, the translations are not being persisted into the database, and also the referencing is missing.
Note: I had to downgrade ORM from v3 to v2 in order go get latest doctrine-behaviors (see #757 (comment) )
So flush did not persist the translations, for that I found #525. This at least inserted the translations, but this is not the official way. Anyway the tables are not referenced, for that I found #532, which talks about expecting columns locale, translatable_id, which would make sense. He talks about registering the bundle to config/bundles.php, but this does not fix the issue.
When I do php bin/console doctrine:schema:update --dump-sql
I receive
CREATE SEQUENCE CategoryTranslation_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
CREATE SEQUENCE Category_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
CREATE TABLE CategoryTranslation (id INT NOT NULL, description VARCHAR(255) NOT NULL, fieldsYouNeedToTranslate VARCHAR(255) NOT NULL, PRIMARY KEY(id));
CREATE TABLE Category (id INT NOT NULL, someFieldYouDoNotNeedToTranslate VARCHAR(255) NOT NULL, PRIMARY KEY(id));
Nothing changed, except the ordering of the lines.
CREATE SEQUENCE Category_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
CREATE SEQUENCE CategoryTranslation_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
CREATE TABLE Category (id INT NOT NULL, someFieldYouDoNotNeedToTranslate VARCHAR(255) NOT NULL, PRIMARY KEY(id));
CREATE TABLE CategoryTranslation (id INT NOT NULL, description VARCHAR(255) NOT NULL, fieldsYouNeedToTranslate VARCHAR(255) NOT NULL, PRIMARY KEY(id));
CREATE TABLE CategoryTranslation (id INT NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id));
CREATE TABLE Category (id INT NOT NULL, someFieldYouDoNotNeedToTranslate VARCHAR(255) NOT NULL, PRIMARY KEY(id));
Assuming it needs bundle registration to generate the references, I register it
Fatal error: Declaration of Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle::getContainerExtension() must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::getContainerExtension(): ?Symfony\Component\DependencyInjection\Extension\ExtensionInterface in /home/api/vendor/knplabs/doctrine-behaviors/src/Bundle/DoctrineBehaviorsBundle.php on line 10
So I should stick to DoctrineBehaviors v2 but it’s not generating references.
Any fix for this? :-)
The text was updated successfully, but these errors were encountered:
First time I use DoctrineBehaviors. I would highly appreciate a bit of automatism for translation handling.
I noticed that after flush, the translations are not being persisted into the database, and also the referencing is missing.
My packages
Note: I had to downgrade ORM from v3 to v2 in order go get latest doctrine-behaviors (see #757 (comment) )
So flush did not persist the translations, for that I found #525. This at least inserted the translations, but this is not the official way. Anyway the tables are not referenced, for that I found #532, which talks about expecting columns
locale
,translatable_id
, which would make sense. He talks about registering the bundle toconfig/bundles.php
, but this does not fix the issue.I ended up testing with 1:1 code from the docs https://github.com/KnpLabs/DoctrineBehaviors/blob/master/docs/translatable.md.
When I do
php bin/console doctrine:schema:update --dump-sql
I receive
There is no referencing to each other.
I register the bundle
Nothing changed, except the ordering of the lines.
Note: I don’t use Flex (and maybe never want to)
For smell of package version problems I downgraded doctrine-behaviors to v1 (
^1
installed1.4.1
but latest v1 version is1.6.1
) and I used 1.4.1 docs https://github.com/KnpLabs/DoctrineBehaviors/tree/1.4.1?tab=readme-ov-file#translatable .Without registering the bundle, I get
Assuming it needs bundle registration to generate the references, I register it
But it seems not to be compatible with Symfony 6.
So I should stick to DoctrineBehaviors v2 but it’s not generating references.
Any fix for this? :-)
The text was updated successfully, but these errors were encountered: