Call to a member function getConfigDependencyKey() on null in /core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php

Created on 30 March 2018, over 6 years ago
Updated 2 February 2024, 11 months ago

I update from 8.4.6 to 8.5.1, when I run drush updb, I get the following error:

Error: Call to a member function getConfigDependencyKey() on null in /home/vagrant/docroot/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php on line 395 #0
/home/vagrant/docroot/web/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(47): Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid->calculateDependencies()
#1 [internal function]: Drupal\views\Plugin\views\display\DisplayPluginBase->calculatePluginDependencies(Object(Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid), 4)
#2 /home/vagrant/docroot/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(960): array_walk(Array, Array)
#3 /home/vagrant/docroot/web/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(47): Drupal\views\Plugin\views\display\DisplayPluginBase->calculateDependencies()
#4 /home/vagrant/docroot/web/core/modules/views/src/Entity/View.php(282):
Drupal\Core\Config\Entity\ConfigEntityBase->calculatePluginDependencies(Object(Drupal\views\Plugin\views\display\Block))
#5 /home/vagrant/docroot/web/core/modules/views/views.post_update.php(269): Drupal\views\Entity\View->calculateDependencies()
#6 [internal function]: {closure}(Object(Drupal\views\Entity\View), 'filtered_landin...')
#7 /home/vagrant/docroot/web/core/modules/views/views.post_update.php(273): array_walk(Array, Object(Closure))
#8 /home/vagrant/docroot/web/core/includes/update.inc(241): views_post_update_bulk_field_moved(Array)
#9 /usr/local/share/drush/commands/core/drupal/batch.inc(163): update_invoke_post_update('views_post_upda...', Object(DrushBatchContext))
#10 /usr/local/share/drush/commands/core/drupal/batch.inc(111): _drush_batch_worker()
#11 /usr/local/share/drush/includes/batch.inc(98): _drush_batch_command('4453')
#12 /usr/local/share/drush/commands/core/drupal/update.inc(174): drush_batch_command('4453')
#13 /usr/local/share/drush/commands/core/core.drush.inc(1221): _update_batch_command('4453')
#14 /usr/local/share/drush/includes/command.inc(366): drush_core_updatedb_batch_process('4453')
#15 /usr/local/share/drush/includes/command.inc(217): _drush_invoke_hooks(Array, Array)
#16 /usr/local/share/drush/includes/command.inc(185): drush_command('4453')
#17 /usr/local/share/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#18 /usr/local/share/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#19 /usr/local/share/drush/drush.php(12): drush_main()
#20 {main}
Error: Call to a member function getConfigDependencyKey() on null in Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid->calculateDependencies() (line 395 of
/home/vagrant/docroot/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php).
DRUSH_BACKEND_OUTPUT_START>>><<<DRUSH_BACKEND_OUTPUT_END, code: 1)
🐛 Bug report
Status

Closed: duplicate

Version

10.0

Component
Taxonomy 

Last updated 3 days ago

  • Maintained by
  • 🇺🇸United States @xjm
  • 🇬🇧United Kingdom @catch
Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom sam.foster

    Hey all,

    (updated before I even posted ! - as writing it gave me an idea - and it fixed my issue and now I've decided to post so anyone having same issue as me can see what I did - which was to manually apply code changes in https://www.drupal.org/files/issues/2021-12-09/2957376.patch by editing the /core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php file as I don't quite see how to actually re-roll a patch to share my fix - but I will be looking at that in a mo!)

    I'm running updates from Drupal 8.9.20 to 9.5.11 and now seeing this error when running 'drush updb' and in relation to the
    views update 'sort_identifier'

    > [notice] Update started: views_post_update_sort_identifier
    > [error] Error: Call to a member function getConfigDependencyKey() on null in Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid->calculateDependencies() (line 427 of /var/www/html/docroot/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php) #0 /var/www/html/docroot/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(71): Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid->calculateDependencies()
    > #1 /var/www/html/docroot/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(89): Drupal\views\Plugin\views\display\DisplayPluginBase->getPluginDependencies(Object(Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid))
    > #2 [internal function]: Drupal\views\Plugin\views\display\DisplayPluginBase->calculatePluginDependencies(Object(Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid), 18)
    > #3 /var/www/html/docroot/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(959): array_walk(Array, Array)
    > #4 /var/www/html/docroot/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(71): Drupal\views\Plugin\views\display\DisplayPluginBase->calculateDependencies()
    > #5 /var/www/html/docroot/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(89): Drupal\Core\Config\Entity\ConfigEntityBase->getPluginDependencies(Object(Drupal\views\Plugin\views\display\DefaultDisplay))
    > #6 /var/www/html/docroot/core/modules/views/src/Entity/View.php(282): Drupal\Core\Config\Entity\ConfigEntityBase->calculatePluginDependencies(Object(Drupal\views\Plugin\views\display\DefaultDisplay))
    > #7 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(320): Drupal\views\Entity\View->calculateDependencies()
    > #8 /var/www/html/docroot/core/modules/views/src/Entity/View.php(292): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
    > #9 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(562): Drupal\views\Entity\View->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
    > #10 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(517): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\views\Entity\View))
    > #11 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(253): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\views\Entity\View))
    > #12 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\views\Entity\View))
    > #13 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(608): Drupal\Core\Entity\EntityBase->save()
    > #14 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(192): Drupal\Core\Config\Entity\ConfigEntityBase->save()
    > #15 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(147): Drupal\Core\Config\Entity\ConfigEntityUpdater->doOne(Object(Drupal\views\Entity\View), Object(Closure))
    > #16 /var/www/html/docroot/core/modules/views/views.post_update.php(88): Drupal\Core\Config\Entity\ConfigEntityUpdater->update(Array, 'view', Object(Closure))
    > #17 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(288): views_post_update_sort_identifier(Array)
    > #18 /var/www/html/vendor/drush/drush/includes/batch.inc(256): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('views_post_upda...', Object(DrushBatchContext))
    > #19 /var/www/html/vendor/drush/drush/includes/batch.inc(201): _drush_batch_worker()
    > #20 /var/www/html/vendor/drush/drush/includes/batch.inc(95): _drush_batch_command('2632')
    > #21 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(131): drush_batch_command('2632')
    > #22 [internal function]: Drush\Commands\core\UpdateDBCommands->process('2632', Array)
    > #23 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
    > #24 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
    > #25 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
    > #26 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
    > #27 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    > #28 /var/www/html/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    > #29 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    > #30 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    > #31 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    > #32 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
    > #33 /var/www/html/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run(Array)
    > #34 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
    > #35 /var/www/html/vendor/bin/drush(119): include('/var/www/html/v...')
    > #36 {main}
    > [warning] Drush command terminated abnormally.

    putting these patches in and running 'composer update --lock' to add the patches as I do for other such issues. These patches not applying - and I think I tried the all now - but I'm not confident I have added to the right section of my composer.json

    Should they be added to 'drupal/core' or 'drupal/views' or 'drupal/taxonomy'

    Or is it just these patches don't yet work for 9.5.11?

    Sam

    (as above - I worked out that the code in the patch https://www.drupal.org/files/issues/2021-12-09/2957376.patch seems to fix the issue in Drupal 9.5.11 it's just that it doesn't successfully apply with Composer for reasons I'm not entirely clear on but which probably relate to the diff between the patch and the target file) - at least having manually changed the code and run drush updb I am now getting a successful outcome of updb.

    Can anyone tell me though - should I really roll back to an earlier version on Drupal and apply a patch successfully or won't it matter if the update has now run using 9.5.11?

  • 🇮🇳India Akhil Babu Chengannur

    I tried to reproduce this issue, but could not (Checked in 10.1.6 and 11 versions)
    Steps followed:

    • Created a custom module and added config for vocabulary 'Custm Tags' in my_module/config/install.
    # File name taxonomy.vocabulary.custom_tags.yml
    langcode: en
    status: true
    name: Custom Tags
    vid: custom_tags
    description: 'Use tags to group articles on similar topics into categories.'
    weight: 0
    dependencies:
      enforced:
        module:
          - my_module
    • Installed the module. 'Custom Tags' vocabulary got created in admin/structure/taxonomy
    • Added few terme to the vocabulary.
    • Created a view for the vocabulary
    • Uninstalled the module.

    Results:

    • 'Custom Tags' got detered from admin/structure/taxonomy
    • The view created for 'Custom Tags' also got deleted.

    The issue summary needs to be updated with the proper steps to reproduce if this issue still exists.

  • 🇮🇳India Akhil Babu Chengannur

    Added the comment in the wrong issue. Removing the tags

Production build 0.71.5 2024