Remove Drupal 8 Legacy Code

Created on 23 May 2020, about 4 years ago
Updated 26 October 2023, 8 months ago

Problem/Motivation

Hello project maintainers,

There is a small amount of legacy code in message_subscribe_email.

Change

function message_subscribe_email_install() {
  // Add the `message_subscribe_email` field to the user form.
  /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */
  if (method_exists(\Drupal::service('entity_display.repository'), 'getFormDisplay')) {
    $display = \Drupal::service('entity_display.repository')->getFormDisplay('user', 'user');
  }
  else {
    // Pre-Drupal 8.8.
    $display = entity_get_form_display('user', 'user', 'default');
  }
  // ...
}

To

function message_subscribe_email_install() {
  // Add the `message_subscribe_email` field to the user form.
  /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */
  $display = \Drupal::service('entity_display.repository')->getFormDisplay('user', 'user');
  // ...
}
πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024