Import instagram posts as nodes automatically with the instagram importer module for drupal 8 & 9.


Apr 24, 2017 in Drupal 8, Snippets

By default, users with the permission of 'administer users' cannot assign roles on the user registration form. With this snippet you can, but make sure to hide the 'administrator'-role for your users.

 * Allow adding roles in user registration form
function MYMODULE_form_user_register_form_alter(&$form, &$form_state, $form_id) {
    $form['account']['roles']['#access'] = TRUE;