Bug #89616

Epic #90106: [Extbase] Priority Bugfixes

Extbase returns deleted objects if only endtime is configured

Added by Mathias Brodala over 1 year ago. Updated about 1 month ago.

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

0%

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
#1

Updated by Mathias Brodala over 1 year ago

  • Description updated (diff)
#2

Updated by Mathias Brodala over 1 year ago

  • Description updated (diff)
#3

Updated by Mathias Brodala over 1 year ago

  • Description updated (diff)
#4

Updated by Mathias Brodala over 1 year ago

  • Is Regression set to Yes

Looks like this is a regression which came with the migration to Doctrine in TYPO3v8. In TYPO3v7 and older BEenableFields() always returns braces around the two endtime constraints:

$query[] = '(' . $field . '=0 OR ' . $field . '>' . $GLOBALS['SIM_ACCESS_TIME'] . ')';
#5

Updated by Alexander Schnitzler over 1 year ago

  • Parent task set to #90106
#6

Updated by Alexander Schnitzler over 1 year ago

  • Status changed from New to Accepted
#7

Updated by Gerrit Code Review about 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#8

Updated by Gerrit Code Review about 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#9

Updated by Gerrit Code Review about 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#10

Updated by Gerrit Code Review 10 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#11

Updated by Gerrit Code Review 8 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#12

Updated by Gerrit Code Review 8 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#13

Updated by Gerrit Code Review 8 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#14

Updated by Gerrit Code Review 3 months ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#15

Updated by Gerrit Code Review 3 months ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

#16

Updated by Gerrit Code Review about 1 month ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64658

Also available in: Atom PDF