]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Favorite/FavoritePlugin.php
user is a protected property in UAS/AtomUserNoticeFeed
[quix0rs-gnu-social.git] / plugins / Favorite / FavoritePlugin.php
index a9a95f80cc9da746c37672af90f70f188fad87fd..77f0531609d07af1adafdfa8c48aafa3646ad3f1 100644 (file)
@@ -59,6 +59,10 @@ class FavoritePlugin extends ActivityHandlerPlugin
         $user->whereAdd('emailnotifyfav IS NOT NULL');
         if ($user->find()) {
             printfnq("Detected old User table (emailnotifyfav IS NOT NULL). Moving 'emailnotifyfav' property to Profile_prefs...");
+            // First we'll make sure Profile_prefs exists
+            $schema = Schema::get();
+            $schema->ensureTable('profile_prefs', Profile_prefs::schemaDef());
+
             // Make sure we have our own tables setup properly
             while ($user->fetch()) {
                 $user->setPref('email', 'notify_fave', $user->emailnotifyfav);
@@ -349,7 +353,7 @@ class FavoritePlugin extends ActivityHandlerPlugin
     {
         $faves = array();
         $fave = new Fave();
-        $fave->user_id = $uas->user->id;
+        $fave->user_id = $uas->getUser()->id;
 
         if (!empty($uas->after)) {
             $fave->whereAdd("modified > '" . common_sql_date($uas->after) . "'");