Story #69617: FormEngine bugs
diff-view not working for categories if default changes
the diff-view of a translated record shows "N/A" if there are changes made to the default language.
#4 Updated by Manuel Selbach over 3 years ago
- Go to the backend with at least 2 languages
- edit a record in the default language and select a category
- copy that record into another language
- edit the copied record
- go to the categories tab
- underneath the categories tree, should be the layer "Changed in original translation"
Before the patch there will be "N/A".
After the patch the categories of the "original" language should be listed at this position.
#5 Updated by Nicole Cordes over 3 years ago
Unfortunately I can't reproduce your issue with the provided information.
What I did:
1) new record with enabled first category
2) translated that record to another language
3) edit the translated record -> tab categories -> displays the selected category and the parents one correct
Can you provided screenshots of your issue or further steps to reproduce the problem?
#6 Updated by Manuel Selbach over 3 years ago
I´m sorry, I´ve forgotten to explain the hole story.
After it has been copied, you select other categories in the "default" language.
Now the "diff-view" will be presented in the translated record if you open it to edit with "N/A" under the categories tree.
After the patch is a applied, the correct diff will be visualized.
#12 Updated by Christian Kuhn over 3 years ago
Ok, first an explanation of the feature itself:
the "Changed in original translation" diff view is meant to show in a translated record changes that have been done to a default language record after the translated record was created. and it has nothing to do with the bootstrap package:
Here is a flow to reproduce:
- Create a page
- Add a tt_content record on this page, fill a simple field like header.
- Create a page translation
- Translate (not copy) the tt_content record.
- Then change the default language record, NOT the translated record, change header.
- On opening the translated record, it will now show that the default record has been changed with a "diff" view indicating which specific parts should be considered to update the translation.
This feature is actually rather nifty ;)
The code behind works as such: On creation of the translated record the current values of the default language record are fetched, serialized and put into a db field of the translated record. If the translated record is opened, this is unserialized again and compared with the "current" values of the default record. If that is different, this diff view is shown.
The issue with "categories" is now that categories is a relation to a different table's record. So it does not store the value itself, but the number of connected records only.
The proposed patch lets the code look up the currently connected records of the translated record with the current state of the default language record. This is wrong, it should compare the former and "now" state of the default record only instead, but unfortunately the record resolution of related tables are not stored in the serialized thing at all.
Ergo: there is currently no fix available, it would mean we resolve all foreign connection for a record when the translation is created (which would be hard).