Extra Curly Brace in OpenIDConnect.php

Created on 18 April 2024, 2 months ago

Problem/Motivation

After updating module to version 3.0.0-alpha3 I received the following error when clicking on the settings tab:
ParseError: syntax error, unexpected token "if", expecting "function" or "const" in Composer\Autoload
{closure}() (line 726 of modules/contrib/openid_connect/src/OpenIDConnect.php).

Steps to reproduce

Install version 3.0.0-alpha3, click on settings tab in module configuration.

Proposed resolution

Remove extra curly brace on line 722 of:
\modules\contrib\openid_connect\src\OpenIDConnect.php

after close of if, foreach, and else statements:

// Map groups to Drupal roles.
    if (isset($userinfo['groups'])) {
      $role_mappings = $this->configFactory->get('openid_connect.settings')->get('role_mappings') ?? [];
      foreach ($role_mappings as $role => $mappings) {
        if (!empty(array_intersect($mappings, $userinfo['groups']))) {
          // User has a mapped role. Add it to their account.
          $account->addRole($role);
        }
        else {
          // User doesn't have a mapped role. Remove it from their account.
          $account->removeRole($role);
        }
      }
    }
  //} <-- Remove this one

Hope this helps, thanks!

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: cannot reproduce

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024