git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 6e480d24 authored by Evan Prodromou's avatar Evan Prodromou

Upgrade 0.9.x bookmarks to 1.0.x

parent 73afcad3
......@@ -551,4 +551,25 @@ class BookmarkPlugin extends MicroAppPlugin
// TRANS: Application title.
return _m('TITLE','Bookmark');
}
function onEndUpgrade()
{
// 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->find();
while ($notice->fetch()) {
$original = clone($notice);
$notice->verb = ActivityVerb::POST;
$notice->object_type = ActivityObject::BOOKMARK;
$notice->update($original);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment