Skip to content
Snippets Groups Projects

Issue #3213915: Support custom user form modes.

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -81,7 +81,7 @@ function roleassign_restrict_access() {
function roleassign_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (roleassign_restrict_access()) {
// Add the checkboxes to the user register and user edit form.
if ($form_id == 'user_register_form' || $form_id == 'user_form') {
if (isset($form['#entity_type']) && $form['#entity_type'] == 'user') {
// Get all roles that are available.
$roles = user_role_names(TRUE);
Loading