#109937Extbase does not ignore enable fields in BE anymore when fetching relations of records
Description
- 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.
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)