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
You cannot update the nodename of a document and add a new reference in the same transaction. To illustrate the issue better, I have the following code example:
$page = $dm->find(null, $object->getId());
$page->setName('helloo');
$translation = newPageTranslation();
$translation->setLocale('nl_NL');
$translation->setTitle('Over ons');
$translation->setBody('Content voor over ons');
$page->addTranslation($translation);
$dm->persist($page);
$dm->flush();
When running the above code, it will throw the following exception:
i think this is a problem of how references and renamings are handled inside the unit of work. it might also depend on order of execution. if you have time to look into this, i would be glad - i can't promise to find time to dig through that one.
When I find some more debug time I will try and find the issue, I was already looking in how the Jackalope client builds the request to the JCR repository, but I lack the understanding, so I need to know first how everything works. I will give it a try 👍
Well, I need to be able to load the translations of all locales in the same runtime, calls like $page->getTranslations() should work properly. Also I wanted a nice way to add new translations. This is the RFC/Proposal I am currently issuing for Sylius: Sylius/Sylius#4808
To achieve that with the translations system provided by doctrine phpcr-odm, it would require a lot of hacking to make a good public API to work with translations. The only downside with my approach, is that when you require one translation, all of them will be loaded in memory for that document. Or do you know a way to achieve some kind of extra lazy loading with phpcr?
You cannot update the
nodename
of a document and add a new reference in the same transaction. To illustrate the issue better, I have the following code example:When running the above code, it will throw the following exception:
I am not sure if this is a problem in the
phpcr-odm
project or an issue with thejackalope-jackrabbit
transport layer.The text was updated successfully, but these errors were encountered: