The Trash module (https://www.drupal.org/project/trash) works by adding an internal field to all trash-enabled entity types called deleted.

Since installing the Trash module, I am no longer able to use drush updb to update the database as this results in a fatal error…

drush updb
[error]  TypeError: Drupal\field_defaults\Service\FieldDefaultsProcessor::__construct(): Argument #1 ($entityTypeManager) must be of type Drupal\Core\Entity\EntityTypeManager, Drupal\trash\TrashEntityTypeManager given in Drupal\field_defaults\Service\FieldDefaultsProcessor->__construct() (line 27 of C:\laragon\www\bit-by-bit.org\public_html\modules\contrib\field_defaults\src\Service\FieldDefaultsProcessor.php) #0 [internal function]: Drupal\field_defaults\Service\FieldDefaultsProcessor->__construct(Object(Drupal\trash\TrashEntityTypeManager), Object(Drupal\Core\Config\ConfigFactory))
#1 C:\laragon\www\bit-by-bit.org\public_html\vendor\symfony\dependency-injection\ContainerBuilder.php(1202): ReflectionClass->newInstanceArgs(Array)
#2 C:\laragon\www\bit-by-bit.org\public_html\vendor\symfony\dependency-injection\ContainerBuilder.php(637): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, true, 'field_defaults....')
#3 C:\laragon\www\bit-by-bit.org\public_html\vendor\symfony\dependency-injection\ContainerBuilder.php(582): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('field_defaults....', 1)
#4 C:\laragon\www\bit-by-bit.org\public_html\vendor\drush\drush\src\Runtime\LegacyServiceInstantiator.php(289): Symfony\Component\DependencyInjection\ContainerBuilder->get('field_defaults....')
#5 C:\laragon\www\bit-by-bit.org\public_html\vendor\drush\drush\src\Runtime\LegacyServiceInstantiator.php(253): Drush\Runtime\LegacyServiceInstantiator->resolveFromContainer(Object(Drupal\Core\DependencyInjection\ContainerBuilder), 'field_defaults....')
#6 [internal function]: Drush\Runtime\LegacyServiceInstantiator->resolveArgument('@field_defaults...')
#7 C:\laragon\www\bit-by-bit.org\public_html\vendor\drush\drush\src\Runtime\LegacyServiceInstantiator.php(223): array_map(Array, Array)
#8 C:\laragon\www\bit-by-bit.org\public_html\vendor\drush\drush\src\Runtime\LegacyServiceInstantiator.php(193): Drush\Runtime\LegacyServiceInstantiator->resolveArguments(Array) ...
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sirclickalot created an issue. See original summary.

sirclickalot’s picture

amateescu made their first commit to this issue’s fork.

amateescu’s picture

Status: Active » Needs review

This is an easy fix in this module. \Drupal\field_defaults\Commands\FieldDefaultsBulkCommands already does it correctly, it's only \Drupal\field_defaults\Service\FieldDefaultsProcessor that needs to be fixed. I also removed the constructor doxygen because it's not required anymore by Drupal's coding standards.

sirclickalot’s picture

I can confirm that applying the patch from https://git.drupalcode.org/project/field_defaults/-/merge_requests/23 solves the issue foe me.

Thank you!

b_sharpe’s picture

Version: 2.1.0 » 2.1.x-dev
Status: Needs review » Fixed

Wow, not sure how that was missed for so long, thank you!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.