repositorytypo3hidden-fieldextbase

EXTBASE: How to get hidden record


How to get hidden record in frontend? Want to get hidden record then change hidden to 0.


Solution

  • The point is to disable the respectEnableFields property in your querySettings. You can do this in your repository like this:

    class SomeRepository extends \TYPO3\CMS\Extbase\Persistence\Repository 
    {
    
        public function findHiddenByUid($uid)
        {
            $query = $this->createQuery();
            $query->getQuerySettings()->setRespectEnableFields(false);
            $query->matching($query->equals('uid', $uid));
            return $query->execute()->getFirst();
        }
    }