diff --git a/config/profile2.type.main.yml b/config/profile2.type.main.yml new file mode 100644 index 0000000..c9cf322 --- /dev/null +++ b/config/profile2.type.main.yml @@ -0,0 +1,6 @@ +# @todo Are profile types the responsibility of installation profiles? +# The associated permissions definitely are. +id: main +label: Main +registration: '1' +weight: '0' diff --git a/profile2.install b/profile2.install index 32dc1fb..ffd4536 100644 --- a/profile2.install +++ b/profile2.install @@ -6,26 +6,6 @@ */ /** - * Implements hook_install(). - */ -function profile2_install() { - // Add an initial profile type, but only if installed manually. In case the - // module is installed via an installation profile, skip that. - if (!drupal_installation_attempted()) { - entity_info_cache_clear(); - $type = entity_create('profile2_type', array( - 'id' => 'main', - 'label' => t('Main profile'), - 'weight' => 0, - 'registration' => TRUE, - )); - $type->save(); - user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('edit own main profile', 'view own main profile')); - drupal_set_message(t('A main profile type has been created and assigned to all users. Go to the Profile types page to add some fields or to configure further profile types.', array('!url' => url('admin/people/profiles')))); - } -} - -/** * Implements hook_schema(). */ function profile2_schema() {