diff --git a/profile.info b/profile.info index 8f0c4b2..ada65b5 100644 --- a/profile.info +++ b/profile.info @@ -3,4 +3,3 @@ description = Supports configurable user profiles. backdrop = 1.x configure = admin/structure/profiles type = module -dependencies[] = entity_plus diff --git a/profile.module b/profile.module index f8112a6..be9afeb 100644 --- a/profile.module +++ b/profile.module @@ -38,7 +38,7 @@ function profile_entity_info() { 'label' => t('Profile'), 'description' => t('Profile user profiles.'), 'entity class' => 'Profile', - 'controller class' => 'EntityPlusController', + 'controller class' => 'EntityDatabaseStorageController', 'base table' => 'profile', 'fieldable' => TRUE, 'view modes' => array( @@ -61,6 +61,7 @@ function profile_entity_info() { 'access callback' => 'profile_access', 'module' => 'profile', 'metadata controller class' => 'ProfileMetadataController', + 'token type' => 'profile', ), ); @@ -81,6 +82,16 @@ function profile_entity_info() { return $return; } +/** + * Implements hook_entity_info_alter(). + */ +function profile_entity_info_alter(&$entity_info) { + // Switch to the controller provided by Entity Plus if available. + if (module_exists('entity_plus')) { + $entity_info['profile']['controller class'] = 'EntityPlusController'; + } +} + /** * Menu argument loader; Load a profile type by string. *