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

Why do translated entities have the ID of the translation?? #69

Closed
Defcon0 opened this issue Sep 23, 2020 · 2 comments
Closed

Why do translated entities have the ID of the translation?? #69

Defcon0 opened this issue Sep 23, 2020 · 2 comments
Labels

Comments

@Defcon0
Copy link

Defcon0 commented Sep 23, 2020

Hello,

currently we have a struggle because of the following change added in v4:

bbee4ad#diff-56e9eeb0a83d5059b7bccbea1878371bR112

In v3 the id always stayed the id of the original record. If in another context, only the translated values have been joined into the record.

Not the id gets overridden, too. This way I can't have the same code for all languages but always have to check if I'm having a translated record now :-( Even in modules which don't have any dependency to DC_Multilingual and don't know a field langPid for example.

Now I have issues in a module which adds an event registration function to contao and for example checks if a correct code is available for the current event. In English language it now of course (dc_multilingual 4) can't find the correct codes because the id mismatches.

The consequence is that I need to write special code in my module (which in fact hadn't even need to know if the entity is translated in dc_multilingual v3).

I can remember the reason for the change was that the id of the translation was not in the record data after the join has taken place. I understand that. But wouldn't have been better to add a new attribute like translationId?

Of course I know this would be another BC Break, but in fact this particular change in v4 makes it very hard to use it and I don't want to override the functionality in a custom Multilingual class.

Thanks in advance.

Bye Defcon0

@aschempp
Copy link
Member

aschempp commented Jan 6, 2021

thank you for analysing this problem, we're having the same issue in Isotope eCommerce! #61 has introduced this issue

@aschempp
Copy link
Member

aschempp commented Feb 2, 2021

see #70

@aschempp aschempp closed this as completed Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants