Merge remote-tracking branch 'upstream/master' into social-master
authorRoland Haeder <roland@mxchange.org>
Sun, 3 Jan 2016 17:55:37 +0000 (18:55 +0100)
committerRoland Haeder <roland@mxchange.org>
Sun, 3 Jan 2016 17:55:37 +0000 (18:55 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
24 files changed:
1  2 
.gitignore
actions/noticesearch.php
actions/recoverpassword.php
classes/Confirm_address.php
classes/File_redirection.php
classes/File_thumbnail.php
classes/Notice.php
lib/attachmentlistitem.php
lib/default.php
lib/installer.php
lib/noticelistitem.php
lib/util.php
plugins/Autocomplete/actions/autocomplete.php
plugins/Event/EventPlugin.php
plugins/Event/actions/cancelrsvp.php
plugins/Event/classes/Happening.php
plugins/Event/classes/RSVP.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/Oembed/classes/File_oembed.php
plugins/QnA/actions/qnanewanswer.php
plugins/Xmpp/XmppPlugin.php
scripts/nukefile.php
scripts/setpassword.php
scripts/upgrade.php

diff --cc .gitignore
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lib/default.php
Simple merge
Simple merge
Simple merge
diff --cc lib/util.php
Simple merge
Simple merge
Simple merge
@@@ -202,14 -200,19 +200,19 @@@ class Happening extends Managed_DataObj
          return $this->url;
      }
  
+     public function getUri()
+     {
+         return $this->uri;
+     }
      function getNotice()
      {
-         return Notice::getKV('uri', $this->uri);
+         return Notice::getKV('uri', $this->getUri());
      }
  
 -    static function fromNotice($notice)
 +    static function fromNotice(Notice $notice)
      {
-         return Happening::getKV('uri', $notice->uri);
+         return Happening::getKV('uri', $notice->getUri());
      }
  
      function getRSVPs()
@@@ -107,7 -91,40 +91,40 @@@ class RSVP extends Managed_DataObjec
          );
      }
  
 -    function saveNew($profile, $event, $verb, $options=array())
+     static public function beforeSchemaUpdate()
+     {
+         $table = strtolower(get_called_class());
+         $schema = Schema::get();
+         $schemadef = $schema->getTableDef($table);
+         // 2015-12-31 RSVPs refer to Happening by event_uri now, not event_id. Let's migrate!
+         if (isset($schemadef['fields']['event_uri'])) {
+             // We seem to have already migrated, good!
+             return;
+         }
+         // this is a "normal" upgrade from StatusNet for example
+         echo "\nFound old $table table, upgrading it to add 'event_uri' field...";
+         $schemadef['fields']['event_uri'] = array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'Event URI');
+         $schema->ensureTable($table, $schemadef);
+         $rsvp = new RSVP();
+         $rsvp->find();
+         while ($rsvp->fetch()) {
+             $event = Happening::getKV('id', $rsvp->event_id);
+             if (!$event instanceof Happening) {
+                 continue;
+             }
+             $orig = clone($rsvp);
+             $rsvp->event_uri = $event->uri;
+             $rsvp->updateWithKeys($orig);
+         }
+         print "DONE.\n";
+         print "Resuming core schema upgrade...";
+     }
 +    function saveNew(Profile $profile, $event, $verb, array $options = array())
      {
          if (array_key_exists('uri', $options)) {
              $other = RSVP::getKV('uri', $options['uri']);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge