Bug #72961

Story #69617: FormEngine bugs

TCA: using renderMode = tree, the treeConfig => rootUid can't get substituted with Page TSconfig

Added by Steffen Wargalla over 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Start date:
2016-01-27
Due date:
% Done:

100%

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

Description

Having:

'config' => array(
        'type' => 'select',
        'size' => 10,
        'foreign_table' => 'pages',
        'MM' => 'tx_tcshop_product_mm',
        'MM_insert_fields' => array('ident' => 'category'),
        'MM_match_fields' => array('ident' => 'category'),
        'maxitems' => 9999,
        'minitems' => 0,
        'renderMode' => 'tree',
        'treeConfig' => array(
            'expandAll' => 1,
            'parentField' => 'pid',
            'rootUid' => ??????,
            'maxLevels' => 5,
            'appearance' => array(
                'showHeader' => TRUE,
                'nonSelectableLevels' => 0',                
            ),
        ),
    ),

The rootUid = ????? can not be set via page TSConfig.

There was a similar issue in Typo3 6.2, see Bug [[#52672]]


Related issues

Related to TYPO3 Core - Bug #47040: Append treeConfig to allowOverrideMatrix whitelist Closed 2013-04-08
Related to TYPO3 Core - Bug #52672: TCA: using renderMode = tree, the treeConfig => rootUid cant get substituted with Page TSconfig Closed 2013-10-10
Related to TYPO3 Core - Bug #75606: Override label of a flexform field with pageTSconfig not possible anymore Closed 2016-04-14
Related to TYPO3 Core - Feature #75037: renderType selectTree: allow marker like ###CURRENT_PID### for rootUid New 2016-03-13
Related to TYPO3 Core - Bug #71461: CategoryPermissionsAspect does not check changed rootUid of tree Rejected 2015-11-10

Associated revisions

Revision 6ccd5a0b (diff)
Added by Stefan Busemann over 3 years ago

[BUGFIX] Reimplement pageTS support to selectTree

With TCA type=select and renderType=selectTree certain TCA
config options can be modified via pageTS. Those that influence
the data fetching are now properly handled within the data
provider that gathers the tree items.

Example:
TCEFORM.pages.categories.config.treeConfig.rootUid = 2

Release: master, 7.6
Resolves: #72961
Change-Id: I6a452c1439b0fd1f59c23b764b35cc8e34de7aef
Reviewed-on: https://review.typo3.org/47083
Reviewed-by: Jigal van Hemert <>
Tested-by: Jigal van Hemert <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision a3ad40c4 (diff)
Added by Stefan Busemann over 3 years ago

[BUGFIX] Reimplement pageTS support to selectTree

With TCA type=select and renderType=selectTree certain TCA
config options can be modified via pageTS. Those that influence
the data fetching are now properly handled within the data
provider that gathers the tree items.

Example:
TCEFORM.pages.categories.config.treeConfig.rootUid = 2

Release: master, 7.6
Resolves: #72961
Change-Id: I6a452c1439b0fd1f59c23b764b35cc8e34de7aef
Reviewed-on: https://review.typo3.org/47799
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Morton Jonuschat over 3 years ago

  • Target version changed from 7.6.3 to Candidate for patchlevel

#2 Updated by Stefan Busemann over 3 years ago

i can confirm that

TCEFORM.pages.categories.config.treeConfig.rootUid = XXX

works in TYPO3 6.2 but not anymore in 7 LTS.

Also it is not possible to overwrite this setting:

TCEFORM.pages.categories.config.treeConfig.appearance.expandAll = 0

#3 Updated by Felix Nagel over 3 years ago

Confirmed in TYPO3 7.6.2. Probably related to #73209

#4 Updated by Andrea Herzog-Kienast over 3 years ago

As Stefan saied, this seems to work. But now it will even not work with 6.2.19.
If I set

TCEFORM.pages.categories.config.treeConfig.rootUid = 123

I get a fatal error while trying to edit page properties:

Uncaught TYPO3 Exception
#1: PHP Catchable Fatal Error: Argument 2 passed to TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass() must be an array, null given, called in /html/typo3/typo3_src-6.2.19/typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php on line 252 and defined in /html/typo3/typo3_src-6.2.19/typo3/sysext/backend/Classes/Utility/IconUtility.php line 841 (More information)

TYPO3\CMS\Core\Error\Exception thrown in file
/html/typo3/typo3_src-6.2.19/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 101.

Additional this config, which should only use categories fom a folder with ID 123, will not work, I see all categories from all pages.

Supplement:

If you add the ID of a category in pagetsconfig of a rootsite, in 6.2 you will get only this category and children

TCEFORM.pages.categories.config.treeConfig.rootUid = 5

But if you add something like this:

TCEFORM.pages.categories.config.treeConfig.rootUid = 5, 6, 7

you will only see category with UID 5 and Children, but not 6 and 7.

This whole stuff will NOT work with TYPO3 7.6.4

If you chose an ID for a catogory which does not exist in 6.2, the fatal error occurs, please see the error message above, and you can not edit the pageproperties, because of this error.

#5 Updated by Gerrit Code Review over 3 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/47083

#6 Updated by Gerrit Code Review over 3 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/47083

#7 Updated by Gerrit Code Review over 3 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/47083

#8 Updated by Gerrit Code Review over 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47083

#9 Updated by Mathias Schreiber over 3 years ago

  • Parent task set to #69617

#10 Updated by Stephan Bauer over 3 years ago

Patch does not work for me in 7.6.4

Other TCEFORM configurations like 'description.disabled = 1' works.

#11 Updated by Gerrit Code Review over 3 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47083

#12 Updated by Gerrit Code Review over 3 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/47799

#13 Updated by Stefan Busemann over 3 years ago

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

#14 Updated by Rafal Brzeski almost 3 years ago

fatal error still occurs while trying to edit page properties on TYPO3 7.6.12,
please reopen this task.

#1: PHP Catchable Fatal Error: Argument 2 passed to TYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord() must be of the type array, null given, called in 
/home/praca/source/typo3_src-7.6.12/typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php on line 268 and defined in /home/praca/source/typo3_src-7.6.12/typo3/sysext/core/Classes/Imaging/IconFactory.php line 131

#15 Updated by Franz Kugelmann over 2 years ago

Rafal Brzeski wrote:

fatal error still occurs while trying to edit page properties on TYPO3 7.6.12,
please reopen this task.

[...]

Rafal, are you sure you have set an existing category id? We also got this fatal error, but realized we just defined a non-existing id.

#16 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF