Actions
Bug #89616
closedExtbase returns deleted objects if only endtime is configured
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
Actions