Project

General

Profile

Actions

Bug #23552

closed

TCE_Forms Select & group fields remove item bug (have seen #0014599)

Added by Aske Ertmann about 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend User Interface
Target version:
Start date:
2010-09-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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

patch_tceforms.diff (500 Bytes) patch_tceforms.diff Administrator Admin, 2010-09-17 12:18
Screen_Shot_2013-10-30_at_19.03.44.png (42.8 KB) Screen_Shot_2013-10-30_at_19.03.44.png Bjorn Kuipers, 2013-10-30 19:13
Screen_Shot_2013-10-30_at_19.03.56.png (39.7 KB) Screen_Shot_2013-10-30_at_19.03.56.png Bjorn Kuipers, 2013-10-30 19:13
Actions #1

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.

Actions #2

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.

Actions #3

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?

Actions #4

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 !

Actions #5

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

Actions #6

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>

Actions #7

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

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

Actions #9

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.

Actions #10

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

Actions #11

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.

Actions #12

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

Actions #13

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

Actions #14

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

Actions #15

Updated by Christian Plattner almost 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #16

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF