From 9744c5eb28f061ec466a04ba5d1324ddf5b91455 Mon Sep 17 00:00:00 2001 From: Marton Kiss Date: Wed, 16 Apr 2014 14:43:39 +0200 Subject: [PATCH] Override groups visibility field default value After a successfull openid login, the drupal throw an error message related to groups visibility field. Now we are overriding this field's default value, and set it 0. Change-Id: I4df9dd887d02546ddf0e72aa5b4fa311060b84e8 --- modules/groups/groups_auth/groups_auth.module | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/groups/groups_auth/groups_auth.module b/modules/groups/groups_auth/groups_auth.module index 838afcc..78e433e 100644 --- a/modules/groups/groups_auth/groups_auth.module +++ b/modules/groups/groups_auth/groups_auth.module @@ -74,6 +74,10 @@ function groups_auth_form_user_register_form_alter(&$form, &$form_state) { // Use the email returned by Simple Registration if available. $form['account']['mail']['#default_value'] = $response['openid.sreg.email']; } + if (isset($form['group_access'])) { + // set default to: Public - accessible to all site users + $form['group_access'][LANGUAGE_NONE]['#default_value'] = array(0 => 0); + } } else { // Redirect to openstack.org profile registration page drupal_goto("https://www.openstack.org/join/register");