Merge branch '1.0.x' into testing

This commit is contained in:
Evan Prodromou 2011-09-15 17:06:27 -04:00
commit 9f6adb3f52
3 changed files with 42 additions and 13 deletions

View File

@ -1418,3 +1418,7 @@ StartShowInvitationSuccess: Right before showing invitations success msg
EndShowInvitationSuccess: After showing invitations success msg
- $action: invitation action
StartUpgrade: when starting a site upgrade
EndUpgrade: when ending a site upgrade; good place to do your own upgrades

View File

@ -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);
}
}
}

View File

@ -33,23 +33,27 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
function main()
{
updateSchemaCore();
updateSchemaPlugins();
if (Event::handle('StartUpgrade')) {
updateSchemaCore();
updateSchemaPlugins();
// These replace old "fixup_*" scripts
// These replace old "fixup_*" scripts
fixupNoticeRendered();
fixupNoticeConversation();
initConversation();
initInbox();
fixupGroupURI();
fixupNoticeRendered();
fixupNoticeConversation();
initConversation();
initInbox();
fixupGroupURI();
initLocalGroup();
initNoticeReshare();
initLocalGroup();
initNoticeReshare();
initFaveURI();
initSubscriptionURI();
initGroupMemberURI();
initFaveURI();
initSubscriptionURI();
initGroupMemberURI();
Event::handle('EndUpgrade');
}
}
function tableDefs()