D10 Compatibility isse

Created on 22 November 2023, 10 months ago
Updated 18 January 2024, 8 months ago

Problem/Motivation

Steps to reproduce

Upgrade Core to Drupal 10.0.1, Site broken with error message:
The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginException: Plugin (entity:taxonomy_term) instance class "Drupal\taxonomy\Plugin\views\argument_validator\Term" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 98 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('entity:taxonomy_term', Array) (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance('entity:taxonomy_term') (Line: 1177)
Drupal\views\Plugin\views\argument\ArgumentPluginBase->getPlugin('argument_validator') (Line: 1403)
Drupal\views\Plugin\views\argument\ArgumentPluginBase->getContextDefinition() (Line: 117)
Drupal\views\Plugin\Derivative\ViewsBlock->getDerivativeDefinitions(Array) (Line: 101)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array) (Line: 87)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 291)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 181)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 22)
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('block_content:054bb25d-58c9-4c9c-9729-9890ff30d3ea') (Line: 16)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('block_content:054bb25d-58c9-4c9c-9729-9890ff30d3ea', Array) (Line: 76)
Drupal\Component\Plugin\PluginManagerBase->createInstance('block_content:054bb25d-58c9-4c9c-9729-9890ff30d3ea', Array) (Line: 81)
Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('86da661d-47b5-4d0b-a85a-0c496fb85da9') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('86da661d-47b5-4d0b-a85a-0c496fb85da9') (Line: 17)
Drupal\context\Reaction\Blocks\BlockCollection->get('86da661d-47b5-4d0b-a85a-0c496fb85da9') (Line: 149)
Drupal\Component\Plugin\LazyPluginCollection->getIterator() (Line: 284)
Drupal\context\ContextManager->getActiveReactions() (Line: 44)
Drupal\context\EventSubscriber\BlockPageDisplayVariantSubscriber->onSelectPageDisplayVariant(Object, 'render.page_display_variant.select', Object)
call_user_func(Array, Object, 'render.page_display_variant.select', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'render.page_display_variant.select') (Line: 220)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 168)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 692)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

Created a patch:
diff --git a/modules/contrib/media_taxonomy_filter/media_taxonomy_filter.views.inc b/modules/contrib/media_taxonomy_filter/media_taxonomy_filter.views.inc
index d1e105241d..c2da7e0cb9 100644
--- a/modules/contrib/media_taxonomy_filter/media_taxonomy_filter.views.inc
+++ b/modules/contrib/media_taxonomy_filter/media_taxonomy_filter.views.inc
@@ -35,6 +35,6 @@ function media_taxonomy_filter_views_data_alter(&$data) {
*/
function media_taxonomy_filter_views_plugins_argument_validator_alter(array &$plugins) {
$plugins['entity:taxonomy_term']['title'] = t('Taxonomy term ID');
- $plugins['entity:taxonomy_term']['class'] = 'Drupal\taxonomy\Plugin\views\argument_validator\Term';
+ $plugins['entity:taxonomy_term']['class'] = 'Drupal\taxonomy\Plugin\views\argument_validator\TermName';
$plugins['entity:taxonomy_term']['provider'] = 'taxonomy';

Remaining tasks

User interface changes

N.A.

API changes

N.A.

Data model changes

N.A.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024