Feature #51245
closedEpic #86307: Extbase allows to fetch deleted/hidden records (respects ignoreEnableFields)
DataMapper should use defaultquerySettings from repository
100%
Description
Hi there!
I stumbled upon a problem with the DataMapper.
Currently it is not possible for Extbase to inject hidden records in a model.
While this might not be a problem for frontend use, it certainly is when using extbase in the backend.
Currently, when Extbase builds a query to select an object in DataMapper::getPreparedQuery, it does not use the query created by the corresponding repository where RespectEnableFields might be set.
Instead it creates a plain query with RespectStoragePage and RespectSysLanguage set to false. There is no possibility to set RespectEnableFields.
However, the defaultQuerySettings of the corresponding repository might be quite different.
My patch adresses this mismatch by first trying to get the query from a possible repository. This query uses defaultQuerySettings.
Only if no repository is found, a plain query is created.
The patch is for Extbase 4.7 but Extbase 6.1 uses the same method so my patch should apply there as well
Files