Translating workspace record with MM relations
I know there are lots of issues regarding Workspaces, translations and MM-Relations, but I think I've got a bug that no ticket has mentioned before, at least as I could see.
The issue can be reproduces quite easily and consistent.
I created a little extension with 2 record types, that can be selected by each other as many-to-many relations. I append a ZIP with the extension, so others can test it, too.
Steps to reproduce:
1. Setup a fresh TYPO3 instance
2. Install workspaces
3. Install the example extension from the ZIP
4. Create a second system language
5. Setup a basic workspace record, no special configuration needed
6. Add a new page
7. Add a few Leaf-Records
8. Switch into the workspace
9. Add a new Root-Record (Note that you must not add leafs, yet!)
10. Save the new Root-Record
11. Select a Leaf-Record from the Leafs-Select field
12. Save the Root-Record (At this point, the live-placeholder has no relations, but the workspace version does)
13. Translate the Root-Record
After processing the translation, the new, translated Root record looses the relations to the leafs.
The expected behaviour would have been, that the translated Root record gets all the selected leafs from the default language.
The RelationHandler does not use the workspace version uid of the Root record, but the one of the live-placeholder, which does not get changed when changing the workspace Root record.
The RelationHandler needs to take into account, that the uid it gets to resolve the relations isn't the right one and should determine the workspace version of it.
#2 Updated by Thorsten Kahler over 1 year ago
did you check the database state? It may be that the new leave records are created but don't have the correct
sys_language_uid. If that's the case your issue is just another flavour of #48883.
You reported an issue in TYPO3 7 LTS but your change request addresses TYPO3 8 LTS and master. The translation handling changed a lot in version 8.
Does this error still occur in the addressed TYPO3 versions? And why didn't you add
7.6 as target branch to your change request?
#3 Updated by Kevin Ditscheid over 1 year ago
I am pretty sure that this issue isn't just another flavour of the FAL localization issue you linked, because I didn't observe wrong sys_language_uid settings, but the usage of wrong workspace/live ids when resolving the relations in a newly generated workspace record. That said, I did not check if the Leafs have been translated properly, so it could be that the relations resolved by the patched code, are still wrong and I need to investigate this further, later today.
The expected result should be, the translation of the Leafs and the adding of this translated Leafs to the list of selected Leafs in the selected workspace version of the Root.
It could be argued, that the behaviour TYPO3 has now is the right one, because if the Leafs aren't localized, they shouldn't show up in the localized element. This said, it would only be valid to do so, if the Leafs do not have their language set to -1 for "All languages". This would still lead to the current behaviour of fetching the result from the live-placeholder record being kind of wrong.
The issue can be observed in TYPO3 7 the same way it appears in 8.7 and latest master, but since this is not a security issue, the version 7 of TYPO3 isn't supposed to get a fix anymore, afaik.