Bug when navigating to /admin/config/people/cas/attributes

Created on 5 September 2019, over 5 years ago
Updated 31 October 2024, about 2 months ago

TypeError: Argument 2 passed to Drupal\cas_attributes\Form\CasAttributesSettings::generateRoleMappingFormElements() must be of the type array, boolean given, called in cas_attributes/src/Form/CasAttributesSettings.php on line 192

Not sure why this error shows.
I did a print_r($existingRoleMappings) and get an empty
array([0]=> )
Is there a necessity to check the $condition variable if the array is empty.

 $existingRoleMappings = $config->get('role.mappings');
    $roles_options = user_role_names(TRUE);
    unset($roles_options[RoleInterface::AUTHENTICATED_ID]);

    // Add existing mappings to the form.
    foreach ($existingRoleMappings as $index => $condition) {
      $form['role']['mappings'][$index] = $this->generateRoleMappingFormElements($roles_options, $condition);

      $form['role']['mappings'][$index]['delete'] = array(
        '#type' => 'checkbox',
        '#title' => $this->t('Remove this mapping?'),
      );
    }
πŸ› Bug report
Status

Postponed: needs info

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States rjt1224

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024