]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
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
index 9962815a67ad14cacac70c129cdd6773f029c91a,9ef288eca4667c29b6134bc53fd77ad9c02d78a4..fd8c3c8a2aaf6ff841b6461ce48b4295bd30d924
@@@ -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()
index 6a6f7f3811354773907fed9840d6531142d62065,520347eeb629a731105e4f5cb9df745ec2931ccd..c4ffc3ee340bb74ba09be17eac457161f10167e7
@@@ -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