Project

General

Profile

Actions

Bug #89152

closed

renderType='selectTree' generates warning with single value select

Added by Thomas Luzat over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2019-09-11
Due date:
% Done:

100%

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

Description

When configuring a 'select' field like this:

'config' => [
'minitems' => 1,
'maxitems' => 1,
'type' => 'select',
'renderType' => 'selectTree',
'foreign_table' => 'foo',
'treeConfig' => [
'parentField' => 'parent',
],
],

... TYPO3 9.5.9 (and probably 8, possibly 10) generates a warning (which may be converted to an exception) when rendering the tree in the backend:

PHP Warning: implode(): Invalid arguments passed in /var/www/htdocs/web/typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php line 164

This was introduced earlier in 2019 with 18411d12528454d1b71574da5a86837bc11e189e: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60415

Changing the line

$html[] = ' value="' . htmlspecialchars(implode(',', $parameterArray['itemFormElValue'])) . '"';

to

$html[] = ' value="' . htmlspecialchars(is_array($parameterArray['itemFormElValue']) ? implode(',', $parameterArray['itemFormElValue']) : $parameterArray['itemFormElValue']) . '"';

seems to reasonably fix the case here.


Files


Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #86954: Categories are lost, when saving before category tree is loaded completelyClosed2018-11-20

Actions
Related to TYPO3 Core - Bug #96095: BackendLayoutWizard can not handle readOnlyClosedOliver Bartsch2021-11-26

Actions
Related to TYPO3 Core - Bug #96096: InputSlugElement can not handle readOnlyClosedOliver Bartsch2021-11-26

Actions
Related to TYPO3 Core - Bug #91852: 'l10n_display' => 'defaultAsReadonly' not working with mm tableClosed2020-07-23

Actions
Actions

Also available in: Atom PDF