- Issue created by @AaronBauman
- Merge request !13Issue #3532363: instantiate but do not initialize client plugins during route rebuild β (Open) created by AaronBauman
Given:
\Symfony\Component\HttpFoundation\RequestStack::getSession
will throw an unhandled exception.
\Drupal\Core\TempStore\SharedTempStoreFactory
relies on session context to retrieve any stored values
\Drupal\apitools\ClientManager
relies on SharedTempStoreFactory
to initialize its api clients
\Drupal\apitools\Routing\ClientConfigForm
relies on ClientManager
to build routes
updb
and cr
lead to route rebuilding, and do not initialize a session
Proposed resolution(s):
We want to rebuild routes during drush operations, so probably not a good idea to just eat the exception and skip it. And, we need the plugin definition in order to build the route.
So, the solution is to instantiate the client plugin instance by calling the constructor, but avoid calling the client plugin's init()
method - where the session is invoked.
Active
2.0
Code