Bug #74451
closedSelect Tree does not save selected nodes that have never been expanded (collapsed on load and not expanded afterwards)
0%
Description
I have noticed the following bug with 7.6.4 (probably exists longer already), steps to reproduce:
1.) Create a TCA record with at least the following config - easiest way to verify this is to use sys_categories for e.g. pages:
'categories' => array( 'exclude' => 1, 'label' => 'Categories', 'config' => \TYPO3\CMS\Core\Category\CategoryRegistry::getTcaFieldConfiguration( 'tx_events_domain_model_event', 'categories', array( 'minitems' => 1, 'maxitems' => 999, 'treeConfig' => array( 'appearance' => array( 'expandAll' => false ) ) ) ) ),
2.) Create at least 2 main sys_category records with each having at least one subcategory
3.) Create a record that contains the TCA column of step 1
4.) Select one of the subcategories, don't select any others
5.) Save
6.) Collapse all main categories
7.) Save
8.) Expand one of the main categories that DON'T contain the selected subcategory
9.) Select any subcategory of the expanded main category
10.) Now the hidden input element field has been overriden to only contain the newly selected category.
11.) Save results in old categories being lost and only the newly selected being stored (expanding all elements prior to selecting a new category works correctly)
The reason is that all other categories don't yet exist within the tree structure. They seem to be appended once a node is expanded.
Strangely, I thought the setting
loader: new Ext.tree.TreeLoader({ preloadChildren: true, clearOnLoad: false }),
which is part of the TYPO3.Components.Tree.StandardTree should append the children at the beginning.