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
Updated by Aske Ertmann about 14 years ago
Here a screencast reproducing the issue: http://screencast.com/t/OTY0YmRi
Btw. the function the remove button calls is setFormValueManipulate where this issue lies.
Updated by Dmitry Dulepov about 14 years ago
Can't reproduce the issue.
Note that 'length' property shows how many <option> elements are in the <select>, not how many selected elements.
Updated by Lars Malach about 14 years ago
Can't reproduce the issue too.
Aske, can you send us the extension key or the t3x-file? And exists this issue in every webbrowser or in one specific?
Updated by Fedir RYKHTIK almost 12 years ago
- Target version deleted (
0)
Bug still exists in 4.5.22.
Google Chrome Version 23.0.1271.97
Changing fObjSel.size to fObjSel.length resolve the issue.
Thanks, Aske !
Updated by Bart Lammers over 11 years ago
This issue still exists.
Tested with version 4.5.25 and 4.7.10
Change mentioned before this solves it.
Browser: Firefox 19.0.2
Updated by Einar Gislason about 11 years ago
I'm having this issue with TYPO3 6.1.3
I have a flexform inside a content element and when trying to remove a single item they all get removed.
Flexform:
<settings.tabs> <TCEforms> <label>Some random label...</label> <config> <type>group</type> <internal_type>db</internal_type> <allowed>tt_content</allowed> <maxitems>10</maxitems> <show_thumbs>1</show_thumbs> <wizards> <suggest> <type>suggest</type> </suggest> </wizards> </config> </TCEforms> </settings.tabs>
Updated by Fedir RYKHTIK about 11 years ago
Hey, how to push the patch into the core ? We have multiple confirmations !
Updated by Bjorn Kuipers about 11 years ago
- File Screen_Shot_2013-10-30_at_19.03.44.png Screen_Shot_2013-10-30_at_19.03.44.png added
- File Screen_Shot_2013-10-30_at_19.03.56.png Screen_Shot_2013-10-30_at_19.03.56.png added
- Target version set to next-patchlevel
I have the same issue in TYPO3 6.1.5 for managing the items in a Record Collection.
When creating a Record Collection of type 'static record composition' and that holds a custom table records, removing a single item is not possible. The whole list is cleared when attempting to do so. See attached screenshots.
The strange thing is the same button, same TYPO3-site, does work as expected with usergroups on a user.
The only difference I noticed was the option's value. For usergroups the value is numeric, while for the Record Collection items it will contain the tablename + uid. Maybe this has to do with it?
Here is the Javascript that is executed onclick. First one is for usergroups, and second one the items of a Record Collection. (The uid matches for the sys_collection.)
setFormValueManipulate('data[fe_users][164][usergroup]','Remove'); return false setFormValueManipulate('data[sys_collection][3][items]','Remove'); return false
Updated by Jonathan Krusy almost 11 years ago
I can confirm this issue with version 6.1.7
I also had a group-element set by a flexform inside a plugin.
Adding <size>any number</size> to my flexform, solved this issue for me.
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28116
Updated by Francois Suter almost 11 years ago
- Category set to Backend User Interface
- Assignee set to Francois Suter
- Complexity set to easy
- Is Regression set to No
See my comment on Gerrit for another take on the matter. The problem is related to missing size property. The better solution IMO is to set a default size when rendering such a field.
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28116
Updated by Gerrit Code Review almost 11 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28116
Updated by Gerrit Code Review almost 11 years ago
Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28129
Updated by Christian Plattner almost 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e61b2cfaa40108bc91552b671c31539dab561152.