Deprecation: #95261 - Public methods in SectionMarkupGenerated events

See forge#95261

Description

In TYPO3 v10, a new page module has been introduced. In this version, administrators could choose between those two approaches by using a feature toggle. This toggle has been removed in TYPO3 v11, making the TYPO3\CMS\Backend\View\PageLayoutView unused. Two events, introduced in forge#88921, however exposed this class.

Therefore the public methods getPageLayoutView() and getLanguageId() of the BeforeSectionMarkupGeneratedEvent and AfterSectionMarkupGeneratedEvent have been marked as deprecated.

Impact

Calling those methods in event listeners will trigger a PHP E_USER_DEPRECATED error. The extension scanner also detects those calls as weak match.

Affected installations

All installations using one of the mentioned methods are affected.

Migration

Access necessary information using the new methods getPageLayoutContext() and getRecords().

Examples for retrieving information with the new methods:

// Get the language id of the column
$event->getPageLayoutContext()->getSiteLanguage()->getLanguageId();

// Get records of the column
$event->getRecords();

// Get the page record of the column
$event->getPageLayoutContext()->getPageRecord();