Breaking: #88638 - Streamlined SoftRefParser reference lookup
See forge#88638
Description
The Soft Reference Parser is a registry to allow to find parsers (PHP Objects), for a given Parser Type (images, internal links, email links) to keep track of referenced records within arbitrary data (e.g. RTE text-fields).
Parsers can be added or overridden via the hook registry
$GLOBALS
.
Previously, the API method for fetching the proper parsers
TYPO3\
kept a runtime cache of created objects
per type within a global PHP array (T3_
). This allowed to create objects
only once, even if there are multiple necessary parts required.
TYPO3's Core SoftRefParser does not keep any state, but the class now has a
Singleton
, which means that the object is now a re-used object
as before.
Impact
Calling the SoftRefParser factory method does not keep state of the parser
objects via $GLOBALS
anymore.
Instead, Singleton
is recommended for re-using SoftRefParser objects
if they need to keep state.
Affected Installations
TYPO3 installations with extensions that use the API with custom parsers, or the global variable directly.
Migration
Replace the global variable access via the API call to \TYPO3\
, if this
is applicable.
If a custom parser is in use, it is recommended to evaluate whether it contains
re-usable data and switch to Singleton
instead.