Issue Bug Closed

#109937Extbase does not ignore enable fields in BE anymore when fetching relations of records

Markus Klein 06/01/26, 09:05 updated 08/13/26, 21:45

Description

  1. deprecated the ‘ignoreAllEnableFieldsInBe’ feature of Extbase’ query settings.

With #101008 the code was removed from v13.

This feature is vital for any serious Extbase usage in Backend context.

For normal Repository usage the missing feature can be circumvented by overriding the `createQuery()` method.

    /**
     * Returns a query for objects of this repository
     *
     * @return QueryInterface
     * @phpstan-return QueryInterface<T>
     */
    public function createQuery(): QueryInterface
    {
        $query = parent::createQuery();
        if (isset($GLOBALS['TYPO3_REQUEST']) && ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) {
            $query->getQuerySettings()->setIgnoreEnableFields(true);
        }
        return $query;
    }

BUT this does not help when Extbase creates objects from database. There, relations between objects are loaded by ignoring the repository.

https://github.com/TYPO3/typo3/blob/d58272fcaa87c5c7f7395d59fb69986353bbfcad/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php#L459-L459

This leads to the problem, that those queries are NOT Backend context aware and there is NO way anymore to configure this.

The only solution is to bring this deleted feature back to live.

For now, instances have to XCLASS the QuerySettings.

—-

Example:

SeminarDate class has property “seminar” (Seminar class).
If seminar has an end-date in the past, the SeminarDate object will not have a valid seminar-property. (enable fields are not ignored)

Reviews 3

History 1118

  1. Christian Kuhn commented and changed status Accepted New <span data-processor="relativetime" data-value="2026-06-01T09:13:28+00:00" > 06/01/26, 09:13 </span>

    Markus pinged me on this already. This is yet another issue with extbase querySettings – my gut feeling is that we’d need to look at it at a broader scale.

  2. Markus Klein commented <span data-processor="relativetime" data-value="2026-06-01T09:25:20+00:00" > 06/01/26, 09:25 </span>

    Christian Kuhn wrote in #note-3:
    > Markus pinged me on this already. This is yet another issue with extbase querySettings – my gut feeling is that we’d need to look at it at a broader scale.

    We need a broader idea and an immediate fix for 13+14!

  3. Jan Kornblum commented <span data-processor="relativetime" data-value="2026-06-01T11:22:52+00:00" > 06/01/26, 11:22 </span>

    Markus Klein wrote in #note-5:
    > We need a broader idea and an immediate fix for 13+14!
    +1 +1 +1

  4. Markus Klein commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-07-17T16:30:12+00:00" > 07/17/26, 16:30 </span>

    Applied in changeset commit:be653ccbda2c4f5ae6a27ea492953d78edc8b411.

  5. Webadmin no-lastname-given commented <span data-processor="relativetime" data-value="2026-08-13T06:28:19+00:00" > 08/13/26, 06:28 </span>

    Updating to Typo3 13.4.34 was a big surprise yesterday. In our opinion, this change is actually too far-reaching for a bugfix release. Over the past few years, we have developed more than 15 backend modules that rely on the fact that “normal” Extbase queries do NOT return non-enabled elements—consistent with the behavior that has existed for years, including in the backend context.

    Whenever those elements were needed, we implemented custom queries. Now, things are happening in our modules that we never intended. For instance, when using `->findByXY()` functions, and so on.

    Is it possible to restore the previous behavior? As shown above, we can use `setIgnoreEnableFields(false)` via `createQuery()`. But does this setting also apply to relations?

  6. Markus Klein commented <span data-processor="relativetime" data-value="2026-08-13T21:45:00+00:00" > 08/13/26, 21:45 </span>

    Please read the issue description carefully. This wrong behavior was there since the wrong change in v12 and – finally, may your god be blessed – we are happy we have a behaving Extbase for BE.

    If you need frontend-behavior in BE, then you must fake FE in BE; everything else is just wrong. Sorry.
    For a quick-fix you may apply a patch on your instance, to revert to the broken behavior.

    Relations follow the default Typo3QuerySettings. IMO this is broken behavior as well, see #110215.