#95053findByUid not respecting default query settings of repository
Description
In my repository I use:
public function initializeObject()
{
$querySettings = new Typo3QuerySettings();
$querySettings->setRespectStoragePage(false);
$querySettings->setRespectSysLanguage(false);
$querySettings->setIgnoreEnableFields(true);
$this->setDefaultQuerySettings($querySettings);
}
Although setIgnoreEnableFields was set to true in the default query settings I am not able to find hidden elements with findByUid in my controller.
As a workaround, I’ve overridden findByUid in the repository as follows:
public function findByUid($uid)
{
$query = $this->createQuery();
return $query->matching($query->equals('uid', $uid))->execute()->getFirst();
}
This seems to be related to:
https://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/84c4ff2f2ec1ce98a9b170a6869b57cb4bb32a0c
I am not sure if this is a bug. Possibly this is just a missing piece in the documentation.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 3
-
Eric Harrer commented and changed Is Regression 0 <span data-processor="relativetime" data-value="2026-03-04T10:34:48+00:00" > 03/04/26, 10:34 </span>
-
Eric Harrer changed status
NewClosed <span data-processor="relativetime" data-value="2026-03-04T10:41:13+00:00" > 03/04/26, 10:41 </span> -
Garvin Hicking changed Related to #111293 <span data-processor="relativetime" data-value="2026-10-30T15:25:16+00:00" > 10/30/26, 15:25 </span>
Re-evaluation
I re-checked the behavior on
mainand reproduced it today.Result
This is expected Extbase behavior, not a current Core regression.
Reproduction
In a repository configured with default query settings such as:setRespectStoragePage(false)setRespectSysLanguage(false)setIgnoreEnableFields(true)calling
findByUid(20)(where recorduid=20is hidden, i.e.hidden=1) returnsnull, while an explicit repository query can return that record.Why this happens
findByUid()does not use the repository query path:@Repository::findByUid() -> findByIdentifier() -> PersistenceManager::getObjectByIdentifier() -> Generic\\Backend::getObjectByIdentifier()@.
That identifier lookup path creates and uses its own query settings. Repository-level
defaultQuerySettings(includingignoreEnableFields) are not applied there.Historical context
This temporarily changed behavior so
findByUid()respected repository query settings.This reverted the above behavior by routing identifier lookups through the storage backend again.
This kept runtime behavior unchanged and clarified documentation/comments around
setDefaultQuerySettings().This explicitly documents that
findByUid()/getObjectByIdentifier()do not use repository default query settings.Source: RST file in core
Conclusion
No Core bug here.
For use cases that must honor
ignoreEnableFields(or other repository default query settings), use an explicit query method instead offindByUid().I suggest closing this as No bug / expected behavior.