From 0a6f7c1914cf78655d4700a84269faadf7ef69e3 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 17 Mar 2011 01:16:48 +0000 Subject: Fixes #3141. Disabling twitter_api and oauth_api upon upgrade because we can't check previous states. Adding an admin notice. twitter_api conflicts with twitterservice and oauth_api conflicts with oauth_lib. git-svn-id: http://code.elgg.org/elgg/trunk@8742 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../2011031400-1.8_svn-oauth_api-8f33ee79c3e66222.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'engine/lib/upgrades/2011031400-1.8_svn-oauth_api-8f33ee79c3e66222.php') diff --git a/engine/lib/upgrades/2011031400-1.8_svn-oauth_api-8f33ee79c3e66222.php b/engine/lib/upgrades/2011031400-1.8_svn-oauth_api-8f33ee79c3e66222.php index 98c00f506..e85268481 100644 --- a/engine/lib/upgrades/2011031400-1.8_svn-oauth_api-8f33ee79c3e66222.php +++ b/engine/lib/upgrades/2011031400-1.8_svn-oauth_api-8f33ee79c3e66222.php @@ -6,9 +6,14 @@ * Switches oauth_lib to oauth_api */ -// make sure we have the latest plugin objects. +$ia = elgg_set_ignore_access(true); + +// make sure we have updated plugins elgg_generate_plugin_entities(); +$show_hidden = access_get_show_hidden_status(); +access_show_hidden_entities(true); + $old = elgg_get_plugin_from_id('oauth_lib'); $new = elgg_get_plugin_from_id('oauth_api'); @@ -16,9 +21,10 @@ if (!$old || !$new) { return true; } -if ($old->isActive()) { - $old->deactivate(); - $new->activate(); -} +$old->deactivate(); +$old->delete(); + +elgg_add_admin_notice('oauth_api:disabled', elgg_echo('update:oauth_api:deactivated')); -$old->delete(); \ No newline at end of file +access_show_hidden_entities($show_hidden); +elgg_set_ignore_access($ia); -- cgit v1.2.3