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

CommentFileSizeAuthor
#3 explode-3438025.patch495 bytessarwan_verma

Issue fork o365-3438025

Command icon 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

Freddy Rodriguez created an issue. See original summary.

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
sarwan_verma’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review
StatusFileSize
new495 bytes

Hi@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.

fabianderijk’s picture

Status: Needs review » Needs work

Hi @sarwan_verma can you create a merge request for this patch?

immaculatexavier made their first commit to this issue’s fork.

immaculatexavier’s picture

Status: Needs work » Needs review

Created MR as per #3 and #4

fabianderijk’s picture

Status: Needs review » Fixed

Thanks for the MR. This is now merged. A new release will be created in a few hours

fgarciap’s picture

Hi,

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)

  • fabianderijk committed 5e9ebb33 on 5.0.x
    Issue #3438025 by fabianderijk, immaculatexavier: TypeError: explode():...
fabianderijk’s picture

@fgarciap i've just updated the dev version of the module. Could you check this version? I can't reproduce this error anymore.

fgarciap’s picture

amazing, 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?

fabianderijk’s picture

Great, 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.

fabianderijk’s picture

The 5.0.7 release had been created and should be available in a few minutes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.