Bug #23552
closedTCE_Forms Select & group fields remove item bug (have seen #0014599)
100%
Description
Hello,
I've been having this problem for a while now, and I finally checked the bug tracker for the issue. The issue is there (#0014599) but has been closed because of problems with reproducing it. Anyway I've got a bit more into the code and can very much reproduce the problem, also with the latest trunk version of class.t3lib_tceforms.php where the javascript is inlined.
Here's the problem: Having selected multiple items in a group or select field. Then trying to remove a single item results in removing all the items.
The solution is very simple by changing fObjSel.size to fObjSel.length (which is already set as the var "l") in line 5637:
(type=="Remove" && fObjSel.size > 1) to (type=="Remove" && l > 1).
This validates the if if there's more than 1 elements in the selected options.
Can although also just be changed to fObjSel.length if preferred.
Related to #0014599
(issue imported from #M15731)
Files