Here, the role object it loaded twice. Note the user_roles() returns role objects keyed by role id.

    $roles = array_keys(user_roles());
    foreach ($roles as $value) {
      $roles_options[$value] = Role::load($value)->get('label');
    }
CommentFileSizeAuthor
#2 3153071-2.patch1.23 KBgaurav.kapoor

Comments

markus_petrux created an issue. See original summary.

gaurav.kapoor’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

@markus_petrux Good catch. Thanks. I have modified the settings form as per suggestion as well added a few more changes.

  • gaurav.kapoor authored a62967d on 8.x-1.x
    Issue #3153071 by gaurav.kapoor: The module settings form reads role...
gaurav.kapoor’s picture

Status: Needs review » Fixed
gaurav.kapoor’s picture

markus_petrux’s picture

Thank you for the quick response! :)

Status: Fixed » Closed (fixed)

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