Epic #86307: Extbase allows to fetch deleted/hidden records (respects ignoreEnableFields)
Extbase persistence layer ignores query settings
\TYPO3\CMS\Extbase\Persistence\Generic\Backend::getObjectByIdentifier() ignores any settings made to the defaultQuerySettings made for any repository. Since some repository methods internally use
getObjectByIdentifier(), this method also must respect the default query settings. Currently there is no way of retrieving a hidden or deleted entity using Extbase. (Besides overwriting the core classes…)
When I disable the test for "enableFields", this setting should be used in any methods, that pull data from the persistence layer.
For example in a repository inside a initializeObject() method:
/** @var $defaultQuerySettings QuerySettingsInterface */ $defaultQuerySettings = $this->objectManager->get(QuerySettingsInterface::class); $defaultQuerySettings->setIgnoreEnableFields(true);
Hidden and deleted entities are excluded by default without any possibility to include them e.g. in controller actions (where the entities are being resolved before the action is executed).
Updated by Alexander Schnitzler over 1 year ago
- Status changed from New to Needs Feedback
I am currently looking at the code base of TYPO3 9.5 and the only method that uses
findByIdentifier, which deliberately does so.
Can you explain what exact method you call on the repository that causes this bug?
Updated by Oliver Pfaff about 1 month ago
I experience this bug also in TYPO3 10. I use the category repository from Extbase and get all categories from a specific parent. As a result I get a mix of default and second language entries. The categories are correctly localized in the system.