- Issue created by @juc1
- πΈπ°Slovakia coaston
+ The same issue. Not working for D10 at all.
Once you click on "add view_mode pattern" following issue :
The website encountered an unexpected error. Please try again later. Error: Class "Drupal\Core\Plugin\ContextAwarePluginBase" not found in include() (line 22 of modules/contrib/view_mode_page/src/Plugin/view_mode_page/AliasType/EntityAliasTypeBase.php). Composer\Autoload\includeFile() (Line: 428) Composer\Autoload\ClassLoader->loadClass() class_exists() (Line: 96) Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (Line: 17) Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 76) Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 62) Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin() (Line: 80) Drupal\Component\Plugin\LazyPluginCollection->get() (Line: 83) Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration() (Line: 99) Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId() (Line: 55) Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct() (Line: 259) Drupal\view_mode_page\Entity\ViewmodepagePattern->getAliasType() (Line: 239) Drupal\view_mode_page\Form\PatternEditForm->buildEntity() (Line: 171) Drupal\Core\Entity\EntityForm->afterBuild() call_user_func_array() (Line: 1083) Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 579) Drupal\Core\Form\FormBuilder->processForm() (Line: 325) Drupal\Core\Form\FormBuilder->buildForm() (Line: 73) Drupal\Core\Controller\FormController->getContentResult() (Line: 39) Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704) Drupal\Core\DrupalKernel->handle() (Line: 19)
- πΈπ°Slovakia coaston
following path should work :
-use Drupal\Core\Plugin\ContextAwarePluginBase; +use Drupal\Core\Plugin\ContextAwarePluginTrait; +use Drupal\Core\Plugin\PluginBase; - class EntityAliasTypeBase extends ontextAwarePluginTrait implements AliasTypeInterface, ContainerFactoryPluginInterface { +class EntityAliasTypeBase extends PluginBase implements AliasTypeInterface, ContainerFactoryPluginInterface { + + use ContextAwarePluginTrait { + getContextValue as protected traitGetContextValue; + }
- π΅πΉPortugal jcnventura
Possibly a duplicate of π Context exception when trying to create url (Drupal 10 is broken!) RTBC
- Status changed to Closed: duplicate
over 1 year ago 6:37am 25 July 2023 - πΈπ°Slovakia coaston
Tnx jcnventura. You are right. It is duplicated. Provided path in your link resolved reported issue.
once again tnx.