Use dependency injection instead of \Drupal::entityTypeManager() in EntityModerationForm

Created on 12 September 2019, over 5 years ago
Updated 12 March 2023, almost 2 years ago

Problem/Motivation

class EntityModerationForm

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
    $entity = $form_state->get('entity');
    /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
    $storage = \Drupal::entityTypeManager()->getStorage($entity->getEntityTypeId());

Steps to reproduce

Proposed resolution

Remaining tasks

Postponed on 🐛 Make the moderation control form an entity form so that it validates entities before save Needs work . See #5.

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Postponed

Version

10.1

Component
Content moderation 

Last updated 24 days ago

Created by

🇭🇺Hungary szato

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.71.5 2024