The \Drupal::entityTypeManager()->getStorage('user_role')->load()
may return null
that will result in error when trying to pass this as the argument to Drupal\simple_oauth\Repositories\ScopeRepository::scopeFactory()
.
This happens when a user has no roles and the consumer has no scopes selected.
<em class="placeholder">TypeError</em>: Argument 1 passed to Drupal\simple_oauth\Repositories\ScopeRepository::scopeFactory() must implement interface Drupal\user\RoleInterface, null given, called in /var/www/docroot/modules/contrib/simple_oauth/src/Repositories/ScopeRepository.php on line 118 in <em class="placeholder">Drupal\simple_oauth\Repositories\ScopeRepository->scopeFactory()</em> (line <em class="placeholder">94</em> of <em class="placeholder">modules/contrib/simple_oauth/src/Repositories/ScopeRepository.php</em>). <pre class="backtrace">Drupal\simple_oauth\Repositories\ScopeRepository->scopeFactory(NULL) (Line: 118)
Drupal\simple_oauth\Repositories\ScopeRepository->addRoleToScopes(Array, 'authenticated') (Line: 74)
Drupal\simple_oauth\Repositories\ScopeRepository->finalizeScopes(Array, 'password', Object, '1') (Line: 56)
League\OAuth2\Server\Grant\PasswordGrant->respondToAccessTokenRequest(Object, Object, Object) (Line: 187)
League\OAuth2\Server\AuthorizationServer->respondToAccessTokenRequest(Object, Object) (Line: 67)
Drupal\simple_oauth\Controller\Oauth2Token->handleToken(Object, Object) (Line: 49)
Drupal\simple_oauth\Controller\Oauth2Token->token(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 41)
Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 49)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Closed: outdated
5.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.