function social_event_an_enroll_uninstall in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()
- 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()
- 10.0.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()
- 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()
Implements hook_uninstall().
File
- modules/
social_features/ social_event/ modules/ social_event_an_enroll/ social_event_an_enroll.install, line 26 - Install, update functions for the social_event_an_enroll module.
Code
function social_event_an_enroll_uninstall() {
$moduleHandler = \Drupal::service('module_handler');
// Delete the email field is social_event_invite is not enabled.
// @todo is there a way to get field dependencies instead of manual?
if (!$moduleHandler
->moduleExists('social_event_invite')) {
$field = FieldConfig::loadByName('event_enrollment', 'event_enrollment', 'field_email');
if ($field) {
$field
->delete();
}
}
}