Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to map references as translated fields. #612

Open
dantleech opened this issue Mar 15, 2015 · 3 comments
Open

Not possible to map references as translated fields. #612

dantleech opened this issue Mar 15, 2015 · 3 comments
Assignees

Comments

@dantleech
Copy link
Contributor

Currently it is not possible to map references (@ReferenceOne, @ReferenceMany) as translated fields. This should be possible I think.

@dbu
Copy link
Member

dbu commented Mar 15, 2015

i can't think of a good reason why this should be forbidden, so i agree.

note that for hierarchy relations (parent, children), we can't limit to locale. neither for referrers. which brings me to realize: referrer mapping of a reference with child translation strategy will need some trick to go to the document and not just see the child node with the translation. or maybe we should just restrict translated references to attribute translation strategy for this reason?

@dantleech
Copy link
Contributor Author

Not too familiar with the child translation strategy, would be a shame to make one strategy better than another, as it would mean people might get to a certain point and realise they need to migrate to the attribute strategy. Will have a look.

@dantleech dantleech self-assigned this Mar 15, 2015
@dbu
Copy link
Member

dbu commented Mar 15, 2015

well, the referrers are done on phpcr level. and child translation strategy means translated fields are stored in a translation child node of the main node of the document. so the referrer would see a GenericDocument that represents the translation, rather than the actual document. we may be able to detect that situation and go to the parent. it will also be tricky with the field name of the referrer, as for attribute strategy, the property name depends on the language. maybe in the end we should have referrers also support translated and figure out the correct property name for attribute strategy and filter out the child translation nodes that are not of the correct locale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants