Breaking: #99807 - Relocated ModifyUrlForCanonicalTagEvent

See forge#99807

Description

The \TYPO3\CMS\Seo\Event\ModifyUrlForCanonicalTagEvent has been improved.

Therefore, the event is now always dispatched after the standard functionality has been executed, such as fetching the URL from the page properties.

The event is furthermore also dispatched in case the canonical tag generation has been disabled via TypoScript or the page properties. This allows greater influence in the generation process, but might break existing setups, which rely on listeners are being called before standard functionality has been executed or only in case generation is enabled.

Effectively, this also means that getUrl() might already return a non-empty string.

Impact

The \TYPO3\CMS\Seo\Event\ModifyUrlForCanonicalTagEvent is now always dispatched when generating canonical tags, just before the final tag markup is being built.

Affected installations

TYPO3 installations with custom extensions, whose event listeners rely on the event being dispatched before standard functionality has been executed or only in case generation has not been disabled.

Migration

Adjust your listeners by respecting the new execution order. Therefore, the event contains the new getCanonicalGenerationDisabledException() method, which can be used to determine whether generation is disabled and the reason for it.