diff options
Diffstat (limited to 'engine/lib/upgrades/2011031300-1.8_svn-twitter_api-12b832a5a7a3e1bd.php')
| -rw-r--r-- | engine/lib/upgrades/2011031300-1.8_svn-twitter_api-12b832a5a7a3e1bd.php | 22 | 
1 files changed, 5 insertions, 17 deletions
| diff --git a/engine/lib/upgrades/2011031300-1.8_svn-twitter_api-12b832a5a7a3e1bd.php b/engine/lib/upgrades/2011031300-1.8_svn-twitter_api-12b832a5a7a3e1bd.php index 0774cbea4..1d82c4995 100644 --- a/engine/lib/upgrades/2011031300-1.8_svn-twitter_api-12b832a5a7a3e1bd.php +++ b/engine/lib/upgrades/2011031300-1.8_svn-twitter_api-12b832a5a7a3e1bd.php @@ -12,24 +12,10 @@ elgg_generate_plugin_entities();  $db_prefix = elgg_get_config('dbprefix');  // find the old settings for twitterservice and copy them to the new one -$options = array( -	'type' => 'object', -	'subtype' => 'plugin', -	'joins' => array("JOIN {$db_prefix}objects_entity oe ON e.guid = oe.guid"), -	'wheres' => array('title = "twitterservice"') -); - -$objs = elgg_get_entities($options); - -if (!$objs) { -	return true; -} - -$service = $objs[0]; - +$service = elgg_get_plugin_from_id('twitterservice');  $api = elgg_get_plugin_from_id('twitter_api'); -if (!$api) { +if (!$api || !$service) {  	return true;  } @@ -41,7 +27,7 @@ foreach ($settings as $setting) {  // update the user settings  $q = "UPDATE {$db_prefix}private_settings -	SET name = replace('twitterservice', 'twitter_api', name) +	SET name = replace(name, 'twitterservice', 'twitter_api')  	WHERE name like '%twitterservice%'";  update_data($q); @@ -50,3 +36,5 @@ if ($service->isActive()) {  	$api->activate();  	$service->deactivate();  } + +$service->delete();
\ No newline at end of file | 
