phpcr-odm icon indicating copy to clipboard operation
phpcr-odm copied to clipboard

Loading translations does not cascade to children when there is a document in the hierarchy without translatable fields

Open uwej711 opened this issue 9 years ago • 5 comments

When you have a container block with no translated fields doLoadTranslation will not load the proper translations of the children of that container due to https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/UnitOfWork.php#L3384

So I have to put a dummy translated field and a locale to the container to make it work.

uwej711 avatar Mar 12 '15 13:03 uwej711

After a quick look I think that check makes sense internally (as it would get called for each document anyway), but maybe it should be skipped if the callee is findTranslation() so that it cascades.

dantleech avatar Mar 12 '15 13:03 dantleech

Or we could check first for cascading and the skip just this document

uwej711 avatar Mar 12 '15 14:03 uwej711

hm, i think the fact that a document is translateable should be inherited too. with B extends A , A translatable and B adding nothing translatable, findTranslation should still have an effect on B. so this is a bug to me.

dbu avatar Mar 13 '15 06:03 dbu

@dbu: this is not about inheritance but about parent child relations.

uwej711 avatar Mar 13 '15 08:03 uwej711

ach, sorry. yeah, it would make a lot of sense to cascade first and then check whether the document itself is translatable.

dbu avatar Mar 13 '15 09:03 dbu