From 016512bf1bc63a887e0444a9e393585a6c8b083c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 19 Mar 2020 21:16:32 +0000 Subject: [PATCH] 4f: Enable autowiring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable autowiring so that the entity type manager is injected into the ArticleRepository service. This fails because the 'node' entity type doesn’t exist. --- web/modules/custom/my_module/my_module.services.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/modules/custom/my_module/my_module.services.yml b/web/modules/custom/my_module/my_module.services.yml index 422db39..7ac77f3 100644 --- a/web/modules/custom/my_module/my_module.services.yml +++ b/web/modules/custom/my_module/my_module.services.yml @@ -1,2 +1,6 @@ services: - Drupal\my_module\Repository\ArticleRepository: ~ + Drupal\Core\Entity\EntityTypeManagerInterface: + alias: entity_type.manager + + Drupal\my_module\Repository\ArticleRepository: + autowire: true