Bug #76661

Suggest Wizard ajax response ignores columnsOverrides

Added by Daniel Siepmann over 4 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2016-06-16
Due date:
% Done:

100%

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

Description

We override the records fields with different configuration.
That works on Rendering the BE-Form, but isn't taken into account while processing the ajax of suggest wizard. He only takes a look at the TCA, without the overwrites and is not usable. The only way to prevent insertions of invalid records is to disable the wizard via columnsOverrides.

Configuration is attached as screenshots, here is the example for copy and paste:

                        'columnsOverrides' => [
                            'records' => [
                                'config' => [
                                    'minitems' => 1,
                                    'foreign_table' => 'fe_users',
                                    'allowed' => 'fe_users',
                                    'wizards' => [
                                        'suggest' => [
                                            'default' => [
                                                'pidList' => '2',
                                                'searchCondition' => 'pid = 2',
                                                'searchWholePhrase' => 1,
                                                'additionalSearchFields' => 'username, city, country',
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],

For 7.6.9 the following line is used to fetch configuration:

        $fieldConfig = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
        $this->overrideFieldNameAndConfigurationForFlexform($table, $field, $row, $fieldConfig);

        $wizardConfig = $fieldConfig['wizards']['suggest'];

        $queryTables = $this->getTablesToQueryFromFieldConfiguration($fieldConfig);
        $whereClause = $this->getWhereClause($fieldConfig);

sysext/backend/Classes/Form/Wizard/SuggestWizard.php

So the configuration is ignored.

Screen Shot 2016-06-16 at 15.04.24.png View - TYPO3 default records configuration (31.9 KB) Daniel Siepmann, 2016-06-16 15:09

Screen Shot 2016-06-16 at 15.04.27.png View - Overwrite of records configuration (37.2 KB) Daniel Siepmann, 2016-06-16 15:09

Screenshot from 2020-04-07 10-06-25.png View (72 KB) Daniel Siepmann, 2020-04-07 11:02

Screenshot from 2020-04-07 10-06-36.png View (130 KB) Daniel Siepmann, 2020-04-07 11:02


Related issues

Related to TYPO3 Core - Bug #86876: TCA columnsOverrides ignores default value Closed 2018-11-07

Associated revisions

Revision 8865b1cf (diff)
Added by Daniel Siepmann 7 months ago

[BUGFIX] Respect columnsOverrides in TCA for suggest wizard

These changes in the SuggestWizardController allow users to override
allowed tables in group fields with columnsOverrides.

Typical usecases for this is to use the records field for tt_content
elements.

Resolves: #76661
Releases: master
Change-Id: Ic566c793f8d953802f5f6ff670fde485c19ed9db
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59444
Tested-by: TYPO3com <>
Tested-by: Josef Glatz <>
Tested-by: Oliver Bartsch <>
Tested-by: Georg Ringer <>
Reviewed-by: Josef Glatz <>
Reviewed-by: Oliver Bartsch <>
Reviewed-by: Georg Ringer <>

History

#1 Updated by Bjoern Jacob about 4 years ago

  • Category changed from Form Framework to FormEngine aka TCEforms
  • Sprint Focus set to On Location Sprint

#2 Updated by Susanne Moog over 3 years ago

  • Complexity set to medium

#3 Updated by Anja Leichsenring about 3 years ago

  • Sprint Focus deleted (On Location Sprint)

#4 Updated by R3 H6 over 2 years ago

Can confirm this bug in TYPO3 8.7

#5 Updated by Daniel Siepmann almost 2 years ago

We again hit this limitation in another project for current CMS v 8.7.20. Looks like the JavaScript needs adjustment, to provide the current Type (CType in case of tt_content). This way the suggest wizard can either simulate the data to use the existing FormDataProvider TcaColumnsOverrides, or can look up any overrides itself, which would lead to duplicate knowledge about structure.

Otherwise the type can be fetched from DB, in assumption that the record was already saved.

#6 Updated by Gerrit Code Review almost 2 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/59444

#7 Updated by Gerrit Code Review almost 2 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/59444

#8 Updated by Gerrit Code Review almost 2 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/59444

#9 Updated by Daniel Siepmann over 1 year ago

  • Related to Bug #86876: TCA columnsOverrides ignores default value added

#10 Updated by Gerrit Code Review over 1 year 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/c/Packages/TYPO3.CMS/+/59444

#11 Updated by Gerrit Code Review about 1 year 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/c/Packages/TYPO3.CMS/+/59444

#12 Updated by Gerrit Code Review 7 months ago

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

#14 Updated by Gerrit Code Review 7 months ago

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

#15 Updated by Daniel Siepmann 7 months ago

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

#16 Updated by Daniel Siepmann 7 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF