diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-20 04:15:15 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-20 04:15:15 +0000 |
commit | fd8579a30ab94d6be4f6aa8156e51e8fc20119aa (patch) | |
tree | 2bd1276957c7a831b3a2b8a07c0f83a8efa898d2 /modules/profile/profile.admin.inc | |
parent | d7b07976bbde2d4b556bc255316a7569accb38ae (diff) | |
download | brdo-fd8579a30ab94d6be4f6aa8156e51e8fc20119aa.tar.gz brdo-fd8579a30ab94d6be4f6aa8156e51e8fc20119aa.tar.bz2 |
#493520 by mfb and oneoftwo: Fixed Profile fields cannot be updated (with tests).
Diffstat (limited to 'modules/profile/profile.admin.inc')
-rw-r--r-- | modules/profile/profile.admin.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 90bc39f85..e54147a8e 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -317,7 +317,7 @@ function profile_field_form_validate($form, &$form_state) { $query->fields('profile_field', array('fid')); if (isset($form_state['values']['fid'])) { - $query->condition('fid', $form_state['values']['fid']); + $query->condition('fid', $form_state['values']['fid'], '<>'); } $query_name = clone $query; @@ -356,9 +356,9 @@ function profile_field_form_submit($form, &$form_state) { if (!isset($form_state['values']['page'])) { $form_state['values']['page'] = ''; } + // Remove all elements that are not profile_field columns. + $values = array_intersect_key($form_state['values'], array_flip(array('type', 'category', 'title', 'name', 'explanation', 'visibility', 'page', 'weight', 'autocomplete', 'required', 'register', 'options'))); if (!isset($form_state['values']['fid'])) { - // Remove all elements that are not profile_field columns. - $values = array_intersect_key($form_state['values'], array_flip(array('type', 'category', 'title', 'name', 'explanation', 'visibility', 'page', 'weight', 'autocomplete', 'required', 'register', 'options'))); db_insert('profile_field') ->fields($values) ->execute(); @@ -367,9 +367,9 @@ function profile_field_form_submit($form, &$form_state) { } else { db_update('profile_field') - ->fields($form_state['values']) + ->fields($values) ->condition('fid', $form_state['values']['fid']) - ->exeucte(); + ->execute(); drupal_set_message(t('The field has been updated.')); } cache_clear_all(); |