Bug #89616

Updated by Mathias Brodala 13 days ago

Given a table configured like this in TCA:

<pre><code class="php">
return [
'ctrl' => [
// ...
'delete' => 'deleted',
'enablecolumns' => [
'endtime' => 'endtime',
],
// ...
],
// ...
];
</code></pre>

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:

<pre><code class="sql">
AND (`tx_mytable`.`endtime` = 0) OR (`tx_mytable`.`endtime` > 1573213620) AND tx_mytable.deleted=0
</code></pre>

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:

<pre><code class="sql">
AND (`tx_mytable`.`starttime` <= 1573214160) AND ((`tx_mytable`.`endtime` = 0) OR (`tx_mytable`.`endtime` > 1573214160)) AND tx_mytable.deleted=0
</code></pre>

Back