#91201DB check module: DeletedRestriction are always added to the QueryBuilder
Description
Problem/Description
Using the Full search feature of the QueryView allows the backend administrator to add the deleted field to the Select fields form field. In the built query the DeletedRestriction::class is always added as restriction, therefore it’s actually useless to add a where clause on the deleted field in the form.
Affected TYPO3 versions at the time of issue-creation
- 10.4.1-dev
- 9.5
I doesn’t tested older versions
Example of resulting DB query
SELECT
`uid`,
`type`,
`sys_language_uid`,
`pid`,
`deleted`,
`deleted`
FROM
`tx_theme_feature_teaser`
WHERE
(
tx_theme_feature_teaser.sys_language_uid = '1' AND tx_theme_feature_teaser.deleted = '1'
) AND(
`tx_theme_feature_teaser`.`deleted` = 0
)
LIMIT 100
What you can see?
deletedfield is added twice for the select (the first is from the manually added, the second from the code)- beside that the
deletedfield has a check for quoted1(this works actually at least in MySQL (I had a issue for that #87710)), - the code adds always an additional check “unquoted” on deleted if it is
0
ToDo(s)
It seems to me that this is a mistake. As an administrator, you have to be able to search for deleted records. If this should never be the case, the column must not be selectable by the TYPO3 administrator.
I can imagine that these restrictions (->add(GeneralUtility::makeInstance(DeletedRestriction::class))) should be added as needed depending on the built query by the administrator.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.