Skip to content

56 · Api service requires the concrete EntityTypeManager and breaks with Trash

Project Editoria11y Accessibility Checker (editoria11y)
Component Code
Category Bug report
Priority Normal
Status Reported upstream as #3625525

Problem/Motivation

The constructor of Drupal\editoria11y\Api type-hints its third argument as the class Drupal\Core\Entity\EntityTypeManager. The Trash module, which Drupal CMS installs, decorates the entity_type.manager service with Drupal\trash\TrashEntityTypeManager, so the service cannot be built:

TypeError: Drupal\editoria11y\Api::__construct(): Argument #3 ($manager) must be of
type Drupal\Core\Entity\EntityTypeManager, Drupal\trash\TrashEntityTypeManager given
(modules/contrib/editoria11y/src/Api.php line 66)

Steps to reproduce

  1. Install Drupal CMS with Educare, Horizon Aid or The Rightup (they enable both modules).
  2. Check Reports → Recent log messages.

Proposed resolution

Type-hint the interface, Drupal\Core\Entity\EntityTypeManagerInterface, as core services do.

Additional information

Found with Drupal CMS 2.2.2 and the Vardot site templates (October 2026). The pages themselves still work; the error is logged during the installation. Not a translation problem.

Copy to drupal.org

Issue title:

Api service requires the concrete EntityTypeManager and breaks with Trash

Issue summary (paste it into the "Issue summary" field; project, component, category and priority are in the table above):

<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The constructor of <code>Drupal\editoria11y\Api</code> type-hints its third argument as the class <code>Drupal\Core\Entity\EntityTypeManager</code>. The Trash module, which Drupal CMS installs, decorates the <code>entity_type.manager</code> service with <code>Drupal\trash\TrashEntityTypeManager</code>, so the service cannot be built:</p>
<code>TypeError: Drupal\editoria11y\Api::__construct(): Argument #3 ($manager) must be of
type Drupal\Core\Entity\EntityTypeManager, Drupal\trash\TrashEntityTypeManager given
(modules/contrib/editoria11y/src/Api.php line 66)</code>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>Install Drupal CMS with Educare, Horizon Aid or The Rightup (they enable both modules).</li>
<li>Check Reports → Recent log messages.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Type-hint the interface, <code>Drupal\Core\Entity\EntityTypeManagerInterface</code>, as core services do.</p>
<h3>Additional information</h3>
<p>Found with Drupal CMS 2.2.2 and the Vardot site templates (October 2026). The pages themselves still work; the error is logged during the installation. Not a translation problem.</p>