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.
Comments
Comment #2
colanSee attached.
Comment #3
colanSorry, had an extra line of whitespace.
Comment #4
anairamzapThanks 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).
Comment #6
cameron prince CreditAttribution: cameron prince at CivicActions commentedThank you colan.
Committed at: https://git.drupalcode.org/project/taxonomy_entity_index/commit/dd198c4
Comment #7
colan