Overview
anchor

As mentioned in the changelog, with this release, we’ve removed a couple of backend JavaScript APIs that were marked as deprecated in previous releases.

In this guide, we’ll go through the list of deprecated APIs and their replacements.

Headless CMS
anchor

We’ve removed a set of security permissions checking-related methods that were accessible via the context.cms.permissions object. To provide more context, here’s an example of how the object could’ve been used in a simple CmsGraphQLSchemaPlugin plugin:

In the example above, the context.cms.permissions.entries.ensure method is used to check if the current user has the required permissions to read entries.

With this release, the context.cms.permissions object has been removed. Instead, you should use the context.cms.accessControl object to perform the same checks.

With this 5.39.2 release, we’ve introduced a new property on the CMS context object, called accessControl. Essentially, this property is a reference to the AccessControlexternal link class instance, which is used to perform authorization checks on content model groups, models, and entries.

If we were to rewrite the previous example using the new context.cms.accessControl object, it would look like this:

Page Builder
anchor

Multiple legacy methods used for subscribing to Page Builder application’s lifecycle events have been removed.

Learn more about lifecycle events in the Lifecycle Events article.

Pages
anchor

Deprecated APIDescriptionReplacement API
onBeforePageCreateTriggered before a page is createdonPageBeforeCreate
onAfterPageCreateTriggered after a page is createdonPageAfterCreate
onBeforePageCreateFromTriggered before a page is created from a page revisiononPageBeforeCreateFrom
onAfterPageCreateFromTriggered after a page is created from a page revisiononPageAfterCreateFrom
onBeforePageUpdateTriggered before a page is updatedonPageBeforeUpdate
onAfterPageUpdateTriggered after a page is updatedonPageAfterUpdate
onBeforePageDeleteTriggered before a page is deletedonPageBeforeDelete
onAfterPageDeleteTriggered after a page is deletedonPageAfterDelete
onBeforePagePublishTriggered before a page is publishedonPageBeforePublish
onAfterPagePublishTriggered after a page is publishedonPageAfterPublish
onBeforePageUnpublishTriggered before a page is unpublishedonPageBeforeUnpublish
onAfterPageUnpublishTriggered after a page is unpublishedonPageAfterUnpublish

Menus
anchor

Deprecated APIDescriptionReplacement API
onBeforeMenuCreateTriggered before a menu is createdonMenuBeforeCreate
onAfterMenuCreateTriggered after a menu is createdonMenuAfterCreate
onBeforeMenuUpdateTriggered before a menu is updatedonMenuBeforeUpdate
onAfterMenuUpdateTriggered after a menu is updatedonMenuAfterUpdate
onBeforeMenuDeleteTriggered before a menu is deletedonMenuBeforeDelete
onAfterMenuDeleteTriggered after a menu is deletedonMenuAfterDelete

Page Categories
anchor

Deprecated APIDescriptionReplacement API
onBeforeCategoryCreateTriggered before a category is createdonCategoryBeforeCreate
onAfterCategoryCreateTriggered after a category is createdonCategoryAfterCreate
onBeforeCategoryUpdateTriggered before a category is updatedonCategoryBeforeUpdate
onAfterCategoryUpdateTriggered after a category is updatedonCategoryAfterUpdate
onBeforeCategoryDeleteTriggered before a category is deletedonCategoryBeforeDelete
onAfterCategoryDeleteTriggered after a category is deletedonCategoryAfterDelete

Page Builder Settings
anchor

Deprecated APIDescriptionReplacement API
onBeforeSettingsUpdateTriggered before Page Builder settings are updatedonSettingsBeforeUpdate
onAfterSettingsUpdateTriggered after Page Builder settings are updatedonSettingsAfterUpdate

Page Builder Installation
anchor

Deprecated APIDescriptionReplacement API
onBeforeInstallTriggered before Page Builder is installedonSystemBeforeInstall
onAfterInstallTriggered after Page Builder is installedonSystemAfterInstall

I18N
anchor

Multiple legacy methods used for subscribing to I18N application’s lifecycle events have been removed.

Locales
anchor

Deprecated APIDescriptionReplacement API
onBeforeLocaleCreateTriggered before a locale is createdonLocaleBeforeCreate
onAfterLocaleCreateTriggered after a locale is createdonLocaleAfterCreate
onBeforeLocaleUpdateTriggered before a locale is updatedonLocaleBeforeUpdate
onAfterLocaleUpdateTriggered after a locale is updatedonLocaleAfterUpdate
onBeforeLocaleDeleteTriggered before a locale is deletedonLocaleBeforeDelete
onAfterLocaleDeleteTriggered after a locale is deletedonLocaleAfterDelete

Installation
anchor

Deprecated APIDescriptionReplacement API
onBeforeInstallTriggered before Page Builder is installedonSystemBeforeInstall
onAfterInstallTriggered after Page Builder is installedonSystemAfterInstall