Multiple problems with using combinations of foreign_selector, foreign_unique and useCombination
IRRE presents several problems when using certain combinations of the foreign_selector, foreign_unique and useCombination properties in asymmetric m:n relations.
Everything works as expected if foreign_selector and foreign_unique have the same value and useCombination is set to true.
If useCombination is disabled, IRRE fails to save the relation records to the database. All relation records get saved with the field pointed to by foreign_field set to 0 instead of the real value. I have attached a workaround that works for me, but I am unsure as to whether it is the right way to approach this issue since I don't know a lot about IRRE.
If useCombination is disabled and foreign_unique is set, dynamically added elements are not removed from the foreign_selector (fixed by #21102).
If useCombination is enabled and foreign_unique is not set, saving the relations fails with the same symptoms as above, but I have not looked into why.
I have attached a small extension to test this, steps to reproduce:
- Install extension and create the tables
- Create and save a new element of "Sub Table" in a sysfolder
- Create a new element of "Main Table" in the same sysfolder
- Add a relation to the sub element to the main element
The relation should now be displayed as "[No title]" instead of the actual sub element.
(issue imported from #M15996)