Breaking: #108055 - Removed PageRenderer related hooks and methods 

See forge#108055

Description 

The removal of frontend asset concatenation and compression as described in Breaking: #108055 - Removed frontend asset concatenation and compression has some impact on the PHP API as well, mainly due to removed code.

The following methods have been removed from the class PageRenderer :

  • disableConcatenateCss()
  • enableConcatenateCss()
  • getConcatenateCss()
  • disableCompressCss()
  • enableCompressCss()
  • getCompressCss()
  • disableConcatenateJavascript()
  • enableConcatenateJavascript()
  • getConcatenateJavascript()
  • disableCompressJavascript()
  • enableCompressJavascript()
  • getCompressJavascript()

The following global configuration registry points have been removed:

  • $GLOBALS['TYPO3_CONF_VARS']['FE']['cssConcatenateHandler']
  • $GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler']
  • $GLOBALS['TYPO3_CONF_VARS']['FE']['jsConcatenateHandler']
  • $GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler']

The following hook has been removed:

  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript']

The following methods of PageRenderer changed their signature. The noted arguments are now unused:

  • addJsInlineCode() : third argument unused
  • addCssInlineBlock() : third argument unused
  • addJsFile() : third and sixth argument unused
  • addJsFooterInlineCode() : third argument unused
  • addJsFooterFile() : third and sixth argument unused
  • addJsLibrary() : fourth and seventh argument unused
  • addJsFooterLibrary() : fourth and seventh argument unused
  • addCssFile() : fifth and eighth argument unused
  • addCssLibrary() : fifth and eighth argument unused

Additionally, registered hooks for:

  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess']
  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform']
  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess']

no longer receive the array keys compress or excludeFromConcatenation inside the following data array keys:

  • jsFiles
  • jsInline
  • jsLibs
  • cssFiles
  • cssInline
  • cssLibs

Impact 

Calling any of the removed methods listed above will raise PHP fatal errors. Registrations for removed hooks are no longer executed. Submitting ignored arguments has no effect anymore, and hook consumers receive slightly different data from the TYPO3 Core due to removed TypoScript configuration values.

Affected installations 

Instances with extensions dealing with low level asset manipulation may be affected. The extension scanner will find affected extensions when they call removed methods or hooks.

Migration 

There is no direct one-to-one migration in this case.

In general, extensions must no longer expect the existence of code related to the TypoScript configuration options config.compressCss , config.compressJs , config.concatenateCss , config.concatenateJs , and the resource properties disableCompression and excludeFromConcatenation .

The removed hooks and "handlers" can be turned into listeners of:

  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess']
  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform']
  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess']

depending on their needs.

Existing hook registrations of these three should check whether the implementations access the array keys compress and excludeFromConcatenation and avoid doing so. If required, affected code may need to determine TypoScript options from the $GLOBALS['TYPO3_REQUEST'] request attribute frontend.typoscript directly.

Another alternative is to avoid hook usage altogether by turning the implementations into PSR-15 middlewares instead.