While the TaxonomyEntityIndexTidDepth class is using proper dependency injection in overriding core, which isn't, the constructors differ. This is because we're injecting the database service.

While that's great, callers aren't expecting the different number of parameters leading to this error:

TypeError: Argument 5 passed to Drupal\taxonomy_entity_index\Plugin\views\argument\TaxonomyEntityIndexTidDepth::__construct() must be an instance of Drupal\Core\Database\Connection, none given, called in /path/to/drupal/web/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php on line 43 in Drupal\taxonomy_entity_index\Plugin\views\argument\TaxonomyEntityIndexTidDepth->__construct() (line 36 of /path/to/taxonomy_entity_index/src/Plugin/views/argument/TaxonomyEntityIndexTidDepth.php)

To fix, we need to add a create() method, which adds this missing service dependency. Callers use this instead of the constructor if it's available.

Patch forthcoming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

colan created an issue. See original summary.

colan’s picture

See attached.

colan’s picture

anairamzap’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch!

I've just tested it with latest dev (1.x-dev) on Drupal 8.7 and it correctly fixes a different error I was getting:

ArgumentCountError: Too few arguments to function Drupal\taxonomy_entity_index\Plugin\views\argument\TaxonomyEntityIndexTidDepth::__construct(), 4 passed in /path/to/docroot/web/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php on line 43 and exactly 5 expected in Drupal\taxonomy_entity_index\Plugin\views\argument\TaxonomyEntityIndexTidDepth->__construct() (line 50 of modules/contrib/taxonomy_entity_index/src/Plugin/views/argument/TaxonomyEntityIndexTidDepth.php).

cameron prince’s picture

Status: Reviewed & tested by the community » Fixed
colan’s picture

Status: Fixed » Closed (fixed)

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