Project

General

Profile

Actions

Bug #102346

open

Variants on prioritizedCountries on CountrySelect form element show values which should be overwritten

Added by Chris Müller about 1 year ago.

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

0%

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

Description

When using the following configuration which defines a CountrySelect element in a form which uses variants to overwrite the prioritizedCountries for a given language:

renderables:
- properties:
  fluidAdditionalAttributes:
    required: required
    autocomplete: country
  prependOptionLabel: prependOptionLabel
  prioritizedCountries:
    - AU
    - CA
    - NZ
    - GB
    - US
type: CountrySelect
identifier: country
label: country
validators:
  - identifier: NotEmpty
variants:
  - identifier: country-pl
    condition: 'siteLanguage("languageId") === 2'
    properties:
      prioritizedCountries:
        - PL

I would expect for the Polish language (language ID = 2), that Poland is the only prioritized country (= visible at the top of the select box). However, the following countries are prioritized:

- PL
- CA
- NZ
- GB
- US

This is obviously wrong. I would expect only:

- PL

to be prioritized.

I tracked it down to the AbstractFormElement->setProperty() method, which receives as value ['PL'] and then ArrayUtility::mergeRecursiveWithOverrule() is called which just overrides the index "0", but does not reset the prioritizedCountries property before.

Using TYPO3 v12.4.7.

No data to display

Actions

Also available in: Atom PDF