flux icon indicating copy to clipboard operation
flux copied to clipboard

$TSFE->fePreview not usable anymore in TYPO3v11+

Open cweiske opened this issue 2 years ago • 2 comments

flux uses $TSFE->fePreview in RecordService::setContextDependentRestrictionsForQueryBuilder: https://github.com/FluidTYPO3/flux/blob/b6d951e351b030dce4b8c0595533cca2535d7d0c/Classes/Service/RecordService.php#L133

This generates a deprecation notice on TYPO3 10:

TYPO3 Deprecation Notice: Property $TSFE->fePreview is not in use anymore as this information is now stored within the FrontendPreview aspect. in typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php line 4101

This property has been

  • deprecated in TYPO3v10: https://docs.typo3.org/c/typo3/cms-core/10.4/en-us/Changelog/10.0/Feature-88791-IntroducePreviewAspectInContext.html
  • removed in TYPO3v11: https://docs.typo3.org/c/typo3/cms-core/11.3/en-us/Changelog/11.0/Breaking-91473-DeprecatedFunctionalityRemoved.html

Since flux supports TYPO3 v8 and v9, how should this be handled? Version-specific code for 8-9 and 10+?

(Related: https://github.com/FluidTYPO3/vhs/issues/1775)

cweiske avatar May 12 '22 09:05 cweiske

Yes, we should have a version_compare and use fallback strategies <10. I guess there could also be some cleanup in the way the VisibilityAspect is being read and used - maybe it's not even necessary on v10+, given that we get the QueryBuilder from the ConnectionPool which may already use the right Context/VisibilityAspect?

NamelessCoder avatar May 12 '22 10:05 NamelessCoder

@NamelessCoder under which circumstances is RecordService used? As far as I see, it's only called from PreviewView. I did enable the admin panel and enabled "show hidden records" and "show hidden pages", but that does not cause it to be used.

cweiske avatar May 16 '22 15:05 cweiske