Actions
Bug #86985
openitemsProcFunc for select->selectSingle shows key instead of label in page translation
Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2018-11-23
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Hi,
I noticed that when using 'itemsProcFunc' I get a strange behaviour when translating a page. When translating the page in the BE then the key is shown instead of the label. This behaviour doesn't appear to be when using 'items' to render a select list. Shouldn't the label be shown instead of the key like it is for rendering lists with 'items'? Or am I missing an implementation step?
... // Here's the snippet from the tca where I override pages 'tx_abcde_blog_media_type' => [ 'exclude' => 0, 'label' => 'Blog type', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', 'itemsProcFunc' => "XYZ\\Abcde\\Lists\\MediaTypes->tcaMediaTypes", ], 'displayCond' => 'FIELD:tx_abcde_blog_content_type:!=:category', ] ... // Here are the functions I am using static public function tcaMediaTypes($config){ $config['items'] = \XYZ\\Abcde\Helper\TCA::arrayToList(self::mediaTypes()); return $config; } static function mediaTypes() { return [ 0 => Languages::translate('blog.mediatypes.0'), 1 => Languages::translate('blog.mediatypes.1'), 2 => Languages::translate('blog.mediatypes.2'), 3 => Languages::translate('blog.mediatypes.3') ]; } public static function arrayToList($aArray) { $list = []; foreach ($aArray as $key => $value) { $list[] = [$value, $key]; } return $list; } ...
I attached a screenshot !Screen Shot 2018-11-23 at 11.50.23.png! to show the issue.
Files
Actions