Closed BrandSven closed 2 months ago
Turns out it was a misconfiguration on our part, not an issue in the module.
@BrandSven what was the reason? We have similar isseus.
The reason were duplicate field names due to inheritance.
Page extends SiteTree: Field "Heading"
ElementalPage extends Page: no fields
ContactPage extends ElementalPage: Field "Heading" (again)
Bad idea...
Once we renamed the field in ContactPage to something else ("ContactHeading"), the translation handling worked as expected.
Module version(s) affected
7.1.2
Description
In our project, we added a new field "Heading" to a page and made it translateable (see below).
We create a new page in the default language and enter the text "default language" into the field "Heading".
Then we create a new draft of that page in a second language, entering "second language" into the field "Heading".
Upon saving the translated page, the default (!) language page has "second language" written in the field "Heading". If we change the field in the default language (back to "default language"), the field in the second (!) language reads "default language".
It seems like somehow the field "Heading" is shared between the two languages. Both languages will always the last saved value from any of the single languages.
The default translateable page fields like Title, MetaDescription etc. are translated correctly and don't display this odd behaviour. Only the new page fields we added behave erroneously.
Is this a bug in the plugin, or a misconfiguration on our part?
Page.php:
How to reproduce
Page.php:
Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)