-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Id, language pid and language column not translated #61
Id, language pid and language column not translated #61
Conversation
@@ -107,8 +108,14 @@ public function buildQueryBuilderForFind($language) | |||
{ | |||
$this->qb->resetQueryParts(); | |||
|
|||
// Always translate system columns | |||
$systemColumns = ['id', $this->langColumnName, $this->pidColumnName]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use the hardcoded id
column here because it's already hardcoded, f.e. https://github.com/terminal42/contao-DC_Multilingual/pull/61/files#diff-56e9eeb0a83d5059b7bccbea1878371bR133
Thank you for this pull request! I think this might be a BC break as I am pretty sure there are some extensions which rely on those column values, so merging it in the current state is not possible IMO. We would have to get rid of
That could be an issue indeed and we should fetch language from the model 👍🏻
I think this could be done using
Isn't a multilingual model always prevented from saving?
The current concept of a multilingual model is that it is not a real-data model but is a combination of the fallback record + language record, so by any means it should not be saved. If you would like to update the language record itself, you would have to fetch it using |
It depends on what is the intended purpose/design of the model, but I'd understand if you see it as a BC break. As a workaround I marked this fields as translatable.
No, it's not and that's why I think the current implementation is broken.
contao-DC_Multilingual/src/Model/Multilingual.php Lines 26 to 35 in 8fef15a
Sorry, you're right. Missed that. |
After a quick internal discussion we are good to merge it into 4.0.1. Thank you David! |
Thanks your the quick release. |
Well, we probably discussed it on Skype, but as that was one year ago I am unable to find any relevant information. Probably I just sent this link and everyone agreed it should be merged 🤷🏻♂️ I think we should ignore that previous discussion anyway and approach this again with a fresh look. |
Right now the
id
,langPid
andlangColumn
doesn't get translated by default which causes several issues:So this pull request always handles such columns as translated columns.
Furthermore it addresses an issue in the
getAlias
method which uses the actual id and notgetLanguageId()
.