[TYPO3-mvc] Additional child records in localization

Viktor Livakivskyi invisible.kinder at gmail.com
Mon Dec 30 19:52:38 CET 2013


Hi, Ludwig.

Many thanks for your effort and useful tips! At least, I know, that I'm not alone struggling with this issue.

Your proposition about master record, which gets all possible child records sounds reasonable in such case.

However we found another workaround, which might be interesting for you or anyone, interested in this issue.
I've created a Gist with it: https://gist.github.com/InvisibleKind/8185705
The main idea is to override getChildren() method and substitute result from model with custom result from childRepository. And since any Repositiry has usefull __call() magic, we are able to do it within findBy[fieldname], where fieldname should be the field, holding parentUid. The trick here is to not pass real uid of parent, but _localizedUid, which obviously hld uid of localized parent record.

Another surprise from TYPO3 Core (6.0) was a fact, that IRRE records, created for localized parent records will have sys_language_uid = 0, while parent will have sys_lnaguage_uid = <correct_language_uid>. So, I've created a hook, which updates sys_language_uid for each new IRRE child.

This functionality is not tested for all possible cases. And I have no idea, if it will work well in case, when you create new children from your FE ExtBase plugin (probably, sys_language_uid should be taken care of), but for get()-ing inline records in localized version it works correctly.

Best regards and Happy New Year!


More information about the TYPO3-project-typo3v4mvc mailing list