Commit 31ba4b8c authored by webchick's avatar webchick

#608894 follow-up by mr.baileys: Better method of hiding Profile module from the UI on new sites.

parent ff9953b3
......@@ -10,3 +10,8 @@ files[] = profile.pages.inc
files[] = profile.install
files[] = profile.test
configure = admin/config/people/profile
; The Profile module is deprecated, and included in Drupal 7 for legacy
; purposes only. By default, the module will be hidden from the UI unless you
; are upgrading a site that uses the Profile module to extend user profiles.
; See user_system_info_alter().
hidden = TRUE
......@@ -3746,13 +3746,13 @@ function user_file_download_access($field, $entity_type, $entity) {
*
* 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.
* of extending users, only make the Profile module available if the profile_*
* tables are 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;
if ($type == 'module' && $file->name == 'profile' && db_table_exists('profile_field')) {
$info['hidden'] = FALSE;
}
}
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