Project

General

Profile

Actions

Bug #75519

closed

Flexform select rendermode tree doesn't respect collapsed nodes

Added by Frans Saris over 8 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2016-04-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

When using a select field in your plugin flexform with rendermode tree the collapsed nodes state isn't saved. So you lose the selection of all subnodes of collapsed nodes after save.

My config:

                    <settings.mediaAlbumsUids>
                        <TCEforms>
                            <label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.mediaAlbumsUids</label>
                            <displayCond>FIELD:switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->randomAsset</displayCond>
                            <config>
                                <type>select</type>
                                <renderMode>tree</renderMode>
                                <treeConfig>
                                    <parentField>parentalbum</parentField>
                                    <appearance>
                                        <showHeader>TRUE</showHeader>
                                        <width>650</width>
                                    </appearance>
                                </treeConfig>
                                <internal_type>db</internal_type>
                                <size>5</size>
                                <autoSizeMax>20</autoSizeMax>
                                <maxitems>1000</maxitems>
                                <minitems>0</minitems>                                
                                <foreign_table>sys_file_collection</foreign_table>
                                <foreign_table_where>AND sys_file_collection.hidden = 0 AND (sys_file_collection.sys_language_uid = 0 OR sys_file_collection.l10n_parent = 0) ORDER BY sys_file_collection.sorting ASC, sys_file_collection.crdate DESC</foreign_table_where>
                            </config>
                        </TCEforms>
                    </settings.mediaAlbumsUids>

Reproducible with https://typo3.org/extensions/repository/view/fs_media_gallery/ and a lot of nested albums (file collections)


Files

2016-10-20_12h18_57.png (33.5 KB) 2016-10-20_12h18_57.png Daniel Hirth, 2016-10-20 12:27

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #75947: Creation of subcategories impossible after upgrading to 6.2.22Closed2016-04-27

Actions
Related to TYPO3 Core - Bug #76374: Select trees not rendered on inline recordsClosed2016-05-30

Actions
Is duplicate of TYPO3 Core - Bug #74451: Select Tree does not save selected nodes that have never been expanded (collapsed on load and not expanded afterwards)Rejected2016-03-07

Actions
Actions #1

Updated by Frans Saris over 8 years ago

  • Assignee set to Frans Saris
Actions #2

Updated by Frans Saris over 8 years ago

It only looses the "hidden" values when an visible node is changed.

Actions #3

Updated by Gerrit Code Review over 8 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/47812

Actions #4

Updated by Frans Saris over 8 years ago

  • Is Regression changed from Yes to No
Actions #5

Updated by Gerrit Code Review over 8 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/47812

Actions #6

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47899

Actions #7

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47900

Actions #8

Updated by Frans Saris over 8 years ago

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

Updated by Jörg Hambuch about 8 years ago

In TYPO3 6.2 (starting from version 6.2.22) this bugfix prevents the category tree from being displayed. Frans, could you please check with 6.2 again?

Actions #10

Updated by Frans Saris about 8 years ago

Hi Jörg,

In what situation does the category tree fail to render (normal TCA, IRRE, flexform, after creating new record, ....)? Do you get a JavaScript error? You are an latest release of 6.2?

Because for my current use-cases it works on latest 6.2

Groet Frans

Actions #11

Updated by Daniel Hirth about 8 years ago

Frans Saris wrote:

Hi Jörg,

In what situation does the category tree fail to render (normal TCA, IRRE, flexform, after creating new record, ....)? Do you get a JavaScript error? You are an latest release of 6.2?

Because for my current use-cases it works on latest 6.2

Groet Frans

Hi,

I seem to have the same problem as Jörg. My TYPO3 Version is 6.2.27.

An Extbase Model "StaffMember" has a property "roles", which is a StorageObject on a Model "Role". The TCA for the property:

'roles' => array(
    'exclude' => 1,
    'label' => '...',
    'config' => array(
        'type' => 'inline',
        'foreign_table' => '..._domain_model_role',
        'foreign_field' => 'staffmember',
        'maxitems'      => 999,
        'appearance' => array(
            'collapseAll' => 1,
            'levelLinksPosition' => 'top',
            'showSynchronizationLink' => 1,
            'showPossibleLocalizationRecords' => 1,
            'showAllLocalizationLink' => 1
        ),
    ),
),

The model "Role" itself has a property "Categories", whose TCA is auto-generated via

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
    $_EXTKEY,'...domain_model_role','categories',$options = array(
    )
);

Now, when openening a Role-Element directly in BE List Module, all categories are shown correctly. When opening a StaffMember-Element, then clicking on a collapsed Child-Role of this Element, the Role gets loaded correctly BUT the category tab is empty. The whole treeview is missing except for the heading (see screenshot).

When changing the setting "collapseAll" to "0", the category trees of the Child-Roles are displayed correctly.

When manually resetting the Patch 4e8a2efce7d5012fed6ae01c4190c1917739ae64 in tree.js, the category trees of the Child-Roles are displayed correctly event with the collapseAll setting. The lines 63-70 of the patch seem to be responsible, when replacing them with

var selected = [];

everything seems to be working fine again. A fix for this would be really welcome.

Actions #12

Updated by Frans Saris about 8 years ago

This part is one of the main parts of the fix:

        // prepare hidden input field (make sure only comma separated uids are present)
        var selected = Ext.fly('treeinput' + this.id).dom.value.split(',');
        for (var i = 0; i < selected.length; i++) {
            var value = selected[i].split('|');
            selected[i] = value[0];
        }
        Ext.fly('treeinput' + this.id).dom.value = selected.join(',');

Could you test if this fixed it for you?

    // prepare hidden input field when found (make sure only comma separated uids are present)
    if (Ext.fly('treeinput' + this.id)) {
        var selected = Ext.fly('treeinput' + this.id).dom.value.split(',');
        for (var i = 0; i < selected.length; i++) {
            var value = selected[i].split('|');
            selected[i] = value[0];
        }
        Ext.fly('treeinput' + this.id).dom.value = selected.join(',');
    }

Please check if the states of the checkboxes that aren't visible are kept.

So collapse some checked leaves, save record twice and check if the checkbox is still checked by expanding the leaves again.

Actions #13

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF