Project

General

Profile

Actions

Bug #89616

closed

Extbase returns deleted objects if only endtime is configured

Added by Mathias Brodala over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2019-11-08
Due date:
% Done:

100%

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

Description

Given a table configured like this in TCA:

return [
    'ctrl' => [
        // ...
        'delete' => 'deleted',
        'enablecolumns' => [
            'endtime' => 'endtime',
        ],
        // ...
    ],
    // ...
];

If used in the BE/CLI context, Extbase will now return deleted rows in case endtime is 0.

This is caused by Extbase's usage of BackendUtility::BEenableFields() will lead Typo3DbQueryParser::getBackendConstraintStatement() to generate a broken statement fragment like this:

 AND (`tx_mytable`.`endtime` = 0) OR (`tx_mytable`.`endtime` > 1573213620) AND tx_mytable.deleted=0

This allows selecting rows which are deleted as long as endtime is 0

Workaround: add at least one additional enablecolumn, so either disabled or starttime. This will lead to a working statement fragment like this:

 AND (`tx_mytable`.`starttime` <= 1573214160) AND ((`tx_mytable`.`endtime` = 0) OR (`tx_mytable`.`endtime` > 1573214160)) AND tx_mytable.deleted=0

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Epic #90106: [Extbase] Priority BugfixesClosed2018-03-07

Actions
Actions

Also available in: Atom PDF