Project

General

Profile

Actions

Bug #65689

closed

Type cast for BackendUtility::getLabelsFromItemsList()

Added by Georg Ringer over 9 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend API
Target version:
Start date:
2015-03-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Because of no strict comparison the mentioned method fails to get the correct value!

Example
EXT:news got the following TCA


'type' => array(
    'exclude' => 0,
    'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.doktype_formlabel',
    'config' => array(
        'type' => 'select',
        'items' => array(
            array($ll . 'tx_news_domain_model_news.type.I.0', 0),
            array($ll . 'tx_news_domain_model_news.type.I.1', 1),
            array($ll . 'tx_news_domain_model_news.type.I.2', 2),
        ),
        'size' => 1,
        'maxitems' => 1,
    )
),

the value of the items is an integer > 0,1,2

if someone extends the extension, like https://github.com/peterkraume/news_exampleextension which adds another type like @blogText", the core compares

the string "blogtext" vs the integer "0" which is TRUE.

As a solution: use a typecast

Actions

Also available in: Atom PDF