Problem/Motivation
The 5.0.6 version shows a white screen error after the user login. This is the error message:
The website encountered an unexpected error. Try again later.
TypeError: explode(): Argument #2 ($string) must be of type string, null given in explode() (line 101 of modules/contrib/o365/src/RolesService.php).
Drupal\o365\RolesService->getConfiguredRoles() (Line: 39)
Drupal\o365\RolesService->handleRoles(Object) (Line: 41)
Drupal\o365\EventSubscriber\RoleEventSubscriber->handleRoles(Object, 'externalauth.login', Object)
call_user_func(Array, Object, 'externalauth.login', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'externalauth.login') (Line: 155)
Drupal\externalauth\ExternalAuth->userLoginFinalize(Object, '0c62fab7-8b3d-44ef-8e49-570f8cad0947', 'o365_sso') (Line: 141)
Drupal\o365_sso\Controller\UserLoginController->login()
call_user_func_array(Array, Array) (Line: 123)
Steps to reproduce
Update the module from 5.0.5 to 5.0.6
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | explode-3438025.patch | 495 bytes | sarwan_verma |
Issue fork o365-3438025
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
abhishek_gupta1 commentedComment #3
sarwan_verma commentedHi@Freddy Rodriguez,
I have fixed this issue "TypeError: explode(): Argument #2 ($string) must be of type string, null given in explode() (line 101 of modules/contrib/o365/src/RolesService.php)" and also attached patch ,
kindly review and verify.
Comment #4
fabianderijkHi @sarwan_verma can you create a merge request for this patch?
Comment #7
immaculatexavier commentedCreated MR as per #3 and #4
Comment #9
fabianderijkThanks for the MR. This is now merged. A new release will be created in a few hours
Comment #10
fgarciap commentedHi,
We have applied this patch and this error it's the same but now in line 106. Did we make anything wrong? When are you going to upload new realease?
The website encountered an unexpected error. Try again later.
TypeError: array_map(): Argument #2 ($array) must be of type array, null given in array_map() (line 106 of modules/contrib/o365/src/RolesService.php).
Drupal\o365\RolesService->getConfiguredRoles() (Line: 39)
Drupal\o365\RolesService->handleRoles() (Line: 41)
Drupal\o365\EventSubscriber\RoleEventSubscriber->handleRoles()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 155)
Drupal\externalauth\ExternalAuth->userLoginFinalize() (Line: 141)
Drupal\o365_sso\Controller\UserLoginController->login()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)
Comment #12
fabianderijk@fgarciap i've just updated the dev version of the module. Could you check this version? I can't reproduce this error anymore.
Comment #13
fgarciap commentedamazing, now works without errors!!!
Big Thanks.
Only one additional question (just curiosity). If we want require login in all pages we have to check your settings module or install one module like 'require login' or similar?
Comment #14
fabianderijkGreat, I'll create the release ASAP.
About the always login. The o365 module won't fix that for you. The module can redirect your users to Microsoft if you want without interference of the Drupal login form, but it won't handle the permissions as you would like.
Comment #15
fabianderijkThe 5.0.7 release had been created and should be available in a few minutes