Project

General

Profile

Actions

Bug #89304

closed

DisplayCond with field sys_language_uid on pages records not working

Added by Oliver Bartsch about 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Start date:
2019-09-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
DisplayCond, sys_language_uid
Complexity:
Is Regression:
Sprint Focus:

Description

I encountered a problem using displayCond with sys_language_uid on pages fields.
When I use FIELD:sys_language_uid:=:0 to show a field only if it’s the default page record the field doesn’t get displayed at all (default or localizations).
If I use :<=:0 or :<:1 it’s working. This is just the case for pages records. The same dispayCond is working for e.g. tt_content.

It seems that this happens because $result['databaseRow']['sys_language_uid] is an empty array due to an empty items array in $result['processedTca'] which gets processed in TcaSelectItems.

Here is the relevant part which evaluates the DisplayCond with the corresponding values:

$operand = '='; // used operand in the DisplayCond
$fieldValue = []; // this is the value of sys_language_uid in this case

// Relevant evaluation in EvaluateDisplayConditions
if (is_array($fieldValue) && count($fieldValue) <= 1) {
    $fieldValue = array_shift($fieldValue);
}
$result = $fieldValue == $operand;

var_dump($result); // bool(false)

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #57082: Centralize languageField / sys_language_uid dropdown generationClosed2014-03-19

Actions
Actions

Also available in: Atom PDF