Project

General

Profile

Actions

Bug #98210

open

multiValueProperties not settable by hook buildFormDefinitionValidationConfiguration

Added by Netresearch DTT GmbH over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2022-08-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hi.

I created a new single select form element with a custom multi select form editor to select the options. While saving the form TYPO3 complains about the missing HMAC. After some fiddling and searching around, I came across \TYPO3\CMS\Form\Domain\Configuration\FrameworkConfiguration\Extractors\FormElement\MultiValuePropertiesExtractor which seems to do the stuff I needed, but unfortunatly only for a fixed subset of inspector editors is allowed. If I add my custom editor here too (Seems that I need to add only $result['formElements'][$formElementType]['multiValueProperties'][] = 'options'; for my Inspector-CustomMultiSelectEditor), everything works as expected.

Later on I discovered the hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['buildFormDefinitionValidationConfiguration'] and regarding the documenation (https://docs.typo3.org/c/typo3/cms-core/9.5/en-us/Changelog/8.7.x/Important-85044-FilterDisallowedPropertiesInFormEditor.html) this should be the way to go to set the properties to allow saving mit custom editor data. But I am not able to pass "properties.options" and "options" to the "multiValueProperties" element.

Looks like there is something missing in the form-extension to handle this?
How do I set "multiValueProperties"?

Actions #1

Updated by Netresearch DTT GmbH over 1 year ago

Seems to be enought if I add my Inspector-CustomMultiSelectEditor to the conditions in \TYPO3\CMS\Form\Domain\Configuration\FrameworkConfiguration\Extractors\FormElement\MultiValuePropertiesExtractor::__invoke and \TYPO3\CMS\Form\Domain\Configuration\FrameworkConfiguration\Extractors\PropertyCollectionElement\MultiValuePropertiesExtractor::__invoke

        if (
            $value !== 'Inspector-PropertyGridEditor'
            && $value !== 'Inspector-MultiSelectEditor'
            && $value !== 'Inspector-ValidationErrorMessageEditor'
            && $value !== 'Inspector-RequiredValidatorEditor'
            && $value !== 'Inspector-CustomMultiSelectEditor'
        ) {
            return;
        }

Actions

Also available in: Atom PDF