diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-20 05:32:31 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-20 05:32:31 +0000 |
commit | 2de34a77f2a9a19e702e41e82d9b98ba63c8efb4 (patch) | |
tree | be3d1f71b1ba69189d98fa3f1d8f32e5936a4323 | |
parent | b0cbc018ec0ab568a6c9bff712a331417a3ccd8d (diff) | |
download | brdo-2de34a77f2a9a19e702e41e82d9b98ba63c8efb4.tar.gz brdo-2de34a77f2a9a19e702e41e82d9b98ba63c8efb4.tar.bz2 |
#608894 by chx, catch: Resolve the conflict between the fieldable users UI and the profile module by hiding Profile module on new sites.
-rw-r--r-- | modules/user/user.module | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 277c5fc5a..500875779 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -3691,3 +3691,27 @@ function user_file_download_access($field, $entity_type, $entity) { return user_view_access($entity); } } + +/** + * Implements hook_system_info_alter(). + * + * Drupal 7 ships with two methods to add additional fields to users: Profile + * module, a legacy module dating back from 2002, and Field API integration + * with users. While Field API support for users currently provides less end + * user features, the inefficient data storage mechanism of Profile module, as + * well as its lack of consistency with the rest of the entity / field based + * systems in Drupal 7, make this a sub-optimal solution to those who were not + * using it in previous releases of Drupal. + * + * To prevent new Drupal 7 sites from installing Profile module, and + * unwittingly ending up with two completely different and incompatible methods + * of extending users, remove it from the available modules by setting it to + * hidden if the profile_* tables are not already present. + * + * @todo: Remove in D8, pending upgrade path. + */ +function user_system_info_alter(&$info, $file, $type) { + if ($type == 'module' && $file->name == 'profile' && !db_table_exists('profile_field')) { + $info['hidden'] = TRUE; + } +} |