By godotislate on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.2.x
Introduced in version:
11.2.0
Issue links:
Description:
Before
$editor = editor_load($format_id);
After (procedural/static)
$editor = \Drupal\editor\Entity\Editor::load($format_id);
After (with dependency injection)
public function __construct(
protected readonly EntityTypeManagerInterface $entityTypeManager,
) {}
...
$editor = $this->entityTypeManager->getStorage('editor')->load($format_id);
...
EditorManager constructor change
Additionally, not passing the $entityTypeManager service to the Drupal\editor\Plugin\EditorManager constructor is deprecated. This parameter will be mandatory in Drupal 12.0.0.
Impacts:
Module developers