Skip to content

Commit

Permalink
Merge pull request #36 from bugfolder/28_smtp_oauth_uninstall
Browse files Browse the repository at this point in the history
Issue #28: Fix uninstall bug if gauth was already disabled.
  • Loading branch information
argiepiano authored Nov 1, 2024
2 parents 1eb3b99 + e0145ca commit 481f247
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions smtp_oauth/smtp_oauth.install
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
* Implements hook_uninstall().
*/
function smtp_oauth_uninstall() {
// We also delete the gauth account.
$gauth_id = config_get('smtp_oauth.settings', 'smtp_oauth_google_api_client_id');
gauth_account_delete($gauth_id, FALSE);
// We also delete the gauth account if we can.
if (module_exists('gauth')) {
$gauth_id = config_get('smtp_oauth.settings', 'smtp_oauth_google_api_client_id');
gauth_account_delete($gauth_id, FALSE);
}
}

/**
Expand Down

0 comments on commit 481f247

Please sign in to comment.