]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3141. Fixed twitter_api and oauth_api upgrades. Only worked on localhost becau...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 16 Mar 2011 02:44:23 +0000 (02:44 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 16 Mar 2011 02:44:23 +0000 (02:44 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8731 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/upgrades/2011031300-1.8_svn-twitter_api-12b832a5a7a3e1bd.php
engine/lib/upgrades/2011031400-1.8_svn-oauth_api-8f33ee79c3e66222.php

index 0774cbea4e3f7532a351401db76b8d8e636ef9b3..1d82c4995ff9b9c8db3ee2b93fb5f9567232c340 100644 (file)
@@ -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
index bfa3402b599bef0a850fdaf032a617d744da0829..98c00f50611398a0a02e9c7571c23254d9bfb1ef 100644 (file)
@@ -19,4 +19,6 @@ if (!$old || !$new) {
 if ($old->isActive()) {
        $old->deactivate();
        $new->activate();
-}
\ No newline at end of file
+}
+
+$old->delete();
\ No newline at end of file