Commit 80664fa9 authored by Steve Gerbino's avatar Steve Gerbino

Fix a syntax error in administrative settings form when the provided

field does not exist or is not associated with a Profile2 field.
parent ea2e249f
......@@ -228,7 +228,7 @@ function realname_registration_settings_validate($form, &$form_state) {
$firstname_field = field_info_field($form_state['values']['realname_registration_firstname_field']);
$match = FALSE;
foreach (profile2_get_types() as $type_name => $profile_type) {
if ($profile_type->data['registration']) {
if ($profile_type->data['registration'] && is_array($firstname_field['bundles']['profile2'])) {
foreach ($firstname_field['bundles']['profile2'] as $key => $value) {
if ($value == $profile_type->type) {
$match = TRUE;
......@@ -262,7 +262,7 @@ function realname_registration_settings_validate($form, &$form_state) {
$middlename_field = field_info_field($form_state['values']['realname_registration_middlename_field']);
$match = FALSE;
foreach (profile2_get_types() as $type_name => $profile_type) {
if ($profile_type->data['registration']) {
if ($profile_type->data['registration'] && is_array($middlename_field['bundles']['profile2'])) {
foreach ($middlename_field['bundles']['profile2'] as $key => $value) {
if ($value == $profile_type->type) {
$match = TRUE;
......@@ -301,7 +301,7 @@ function realname_registration_settings_validate($form, &$form_state) {
$lastname_field = field_info_field($form_state['values']['realname_registration_lastname_field']);
$match = FALSE;
foreach (profile2_get_types() as $type_name => $profile_type) {
if ($profile_type->data['registration']) {
if ($profile_type->data['registration'] && is_array($lastname_field['bundles']['profile2'])) {
foreach ($lastname_field['bundles']['profile2'] as $key => $value) {
if ($value == $profile_type->type) {
$match = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment