Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I need to change the checkboxes from registration form to radio buttons to be sure that the user only select one role.
I've tried to modify this function, but appears the error "Fatal error: Unsupported operand types in ..."
// Generate the form items.
$form['account']['roles_change'] = array(
-- '#type' => 'checkboxes',
++ '#type' => 'radios',
'#title' => isset($form['account']['roles']['#title']) ? $form['account']['roles']['#title'] : t('Roles'),
Could somebody help me?
Thank you!
Comments
Comment #1
dromansab CreditAttribution: dromansab commentedNobody nows how restrict users to select only one role?
Comment #2
Taxoman CreditAttribution: Taxoman commentedPerhaps there is some relevant code in the OG Registration Format module:
http://drupal.org/sandbox/madmatter23/1287462
Comment #3
rudy2342 CreditAttribution: rudy2342 commentedHas anyone figured this out? Did OG Registration Format help? I was close with https://drupal.org/sandbox/wolmi/2022403.
However the checkbox from role delegation is still there for users without the admin toolbar
Comment #4
mattyy21HI I use a JQuery script and checkboxes in "user.module" line 1127. WORK!
Comment #5
dalinThis ticket is very old, but for anyone who comes across it, take a look at
https://www.drupal.org/project/single_user_role