doctrine / phpcr-odm

Doctrine PHPCR ODM
http://www.doctrine-project.org/projects/phpcr-odm.html
MIT License
183 stars 97 forks source link

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

Open uwej711 opened 9 years ago

uwej711 commented 9 years ago

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.

dantleech commented 9 years ago

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.

uwej711 commented 9 years ago

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

dbu commented 9 years ago

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.

uwej711 commented 9 years ago

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

dbu commented 9 years ago

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