Bug #90060

Extending Site configuration TCA with any select-type field does not handle selected values

Added by Claus Due 10 months ago. Updated 5 months ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-01-06
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Problem:

Extending the pseudo-TCA configuration for "Sites" module to add a field of type "select" with multiple options allowed will not render the field with selected values.

Cause:

An explicit check for saved values NOT being an array is implemented, causing any array-like value to be completely ignored

Reasoning:

Given that:

  • Select-type fields with multiple possible options are possible
  • Such values, when saved to site configuration, are possible to store
  • The lack of "selected" status on all options causes second and subsequent saving of form to null such fields' values

I conclude that:

  • We should not be intentionally ignoring array-like values

Solution:

  • Removing the `!is_array` check makes multi-option select fields work correctly
  • This in turn means the entire loop can be replaced with an array union

History

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

#2 Updated by Gerrit Code Review 10 months 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/c/Packages/TYPO3.CMS/+/62825

#3 Updated by Gerrit Code Review 5 months 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/c/Packages/TYPO3.CMS/+/62825

Also available in: Atom PDF