By claudiu.cristea on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.4.x
Introduced in version:
11.4.0
Issue links:
Description:
The content_translation_translate_access() function is deprecated and its logic was moved in the content_translation.manager service as a new ::access() method.
Before
$comment = \Drupal\comment\Entity\Comment::load(123);
if (content_translation_translate_access($comment)) {
// Do something...
}
...
_content_translation_install_field_storage_definitions($settings->getTargetEntityTypeId());
After
$comment = \Drupal\comment\Entity\Comment::load(123);
// In a real case scenario properly inject the content_translation.manager service.
if (\Drupal::service('content_translation.manager')->access($comment)) {
// Do something...
}
...
$this->installFieldStorageDefinitions($settings->getTargetEntityTypeId());
The protected method \Drupal\comment\CommentLazyBuilders::access(), which was only a wrapper around content_translation_translate_access() was also deprecated.
Impacts:
Module developers
Site templates, recipes and distribution developers