Project

General

Profile

Actions

Bug #98073

open

Can not add 2 properties of same inline type in the SiteConfiguration because the GUI overrides form values

Added by Philipp Wrann almost 2 years ago. Updated over 1 year ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2022-08-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
SiteConfiguration
Complexity:
Is Regression:
Sprint Focus:

Description

I wanted to add an additional property to the SiteConfiguration record of type site. My plan was to add multiple domains, that will be requested via ajax to share some cookie-value across multiple domains. I wanted to re-use the site_base_variant record type because its not possible to add own record types and it fits my needs perfectly.

Adding values by editing the yaml file works fine, but using the GUI does not. TYPO3 will start to mix up values, so the values from the baseVariants will be set as values in the fields of my new property. The problem is the data structure, the fields are simply named data[site_base_variant]0[base] and there is no reference to the field-name they relate to.

So i cant use the GUI for my feature for the moment.

There are 2 potential issues/solutions related to this problem:

1) TYPO3 should allow custom records for SiteConfiguration
2) TYPO3 should render the values like they are stored later on: data[site][baseVariant]0[base] and data[site][customProperty]0[base] for example

Both points are valid recommendations

What are your plans in the long run anyway?

Will there be the possibility of adding custom record types to SiteConfiguration? To be honest - at the moment the whole frontend configuration situation is some kind of a mess!
Because some configuration is stored in the SiteConfiguration, other things are configured in typoscript and others again have to be configured via TCA (pages for example) because the SiteConfiguration is restricted to (very) limited features.

Actions #1

Updated by Georg Ringer almost 2 years ago

  • Tracker changed from Story to Bug
Actions #2

Updated by Oliver Hader over 1 year ago

  • Status changed from New to Needs Feedback

Can you please add example configuration files and screenshots, which makes it easier to understand and reproduce the scenario? Thanks in advance!

Actions #3

Updated by Philipp Wrann over 1 year ago

If you add the following code to add a new field to the site-configuration, you can easily test this. Note: The site_base_variant is re-used for a second configuration option. In fact i tried to do exactly that to add UI Support for the CORS Configuration of a Consent-Management Extension i built. I would have added a custom site-configuration data type, but this is not possible, so i tried to re-use the site_base_variant.

If you add this and then create a new site-config, add 2-3 base-variants and 2-3 items to the new column you can see, that they will override each other.

$GLOBALS['SiteConfiguration']['site']['columns']['example_column'] = [
    'label' => 'Example',
    'config' => [
        'type' => 'inline',
        'foreign_table' => 'site_base_variant',
        'appearance' => [
            'enabledControls' => [
                'info' => false,
            ]
        ],
        'overrideChildTca' => [
            'columns' => [
                'base' => [
                    'label' => 'Override',
                ],
                'condition' => [
                    'config' => [
                        'eval' => 'trim',
                    ],
                ],
            ],
            'types' => [
                '1' => [
                    'showitem' => 'base,title,condition',
                ],
            ],
        ],
    ],
];
$GLOBALS['SiteConfiguration']['site']['types']['0']['showitem'] .= ',example_column,';

The problem is, that the form data will be named using the record type insteadof the property name

in pseudocode:

It should be:

// form data for baseVariants
site[baseVariants][0][base] = "foo";
// form data for custom field
site[example_column][0][base] = "bar";

But it is:

// form data for baseVariants
site[site_base_variant][0][base] = "foo";
// form data for custom field
site[site_base_variant][0][base] = "bar";

You can still add all the config you need to the site-configuration but you cant make a GUI for it.... No custom data types, no re-using of existing data types.

Actions

Also available in: Atom PDF