]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Bookmark/BookmarkPlugin.php
Merge branch 'strict-warnings' into 'nightly'
[quix0rs-gnu-social.git] / plugins / Bookmark / BookmarkPlugin.php
index 8b4abd2b42ba0c92e77c2680fceb7db58e936bd4..e6afa0b6daf466e295b786b5aca997a1479aa457 100644 (file)
@@ -306,7 +306,6 @@ class BookmarkPlugin extends MicroAppPlugin
             return true;
         }
 
-        common_debug('Extending activity '.$stored->id.' with '.get_called_class());
         $this->extendActivity($stored, $act, $scoped);
         return false;
     }
@@ -348,14 +347,16 @@ class BookmarkPlugin extends MicroAppPlugin
 
     function onEndUpgrade()
     {
+        printfnq('Making sure Bookmark notices have correct verb and object_type...');
+
         // Version 0.9.x of the plugin didn't stamp notices
         // with verb and object-type (for obvious reasons). Update
         // those notices here.
 
         $notice = new Notice();
         
-        $notice->whereAdd('exists (select uri from bookmark where bookmark.uri = notice.uri)');
-        $notice->whereAdd('((object_type is null) or (object_type = "' .ActivityObject::NOTE.'"))');
+        $notice->joinAdd(array('uri', 'bookmark:uri'));
+        $notice->whereAdd('object_type IS NULL OR object_type = '.$notice->_quote(ActivityObject::NOTE));
 
         $notice->find();
 
@@ -365,6 +366,8 @@ class BookmarkPlugin extends MicroAppPlugin
             $notice->object_type = ActivityObject::BOOKMARK;
             $notice->update($original);
         }
+
+        printfnq("DONE.\n");
     }
 
     public function activityObjectOutputJson(ActivityObject $obj, array &$out)