]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Various last fixes to RSVP I think
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 21 Jan 2016 01:20:50 +0000 (02:20 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 21 Jan 2016 01:20:57 +0000 (02:20 +0100)
plugins/Event/actions/rsvp.php
plugins/Event/classes/Happening.php
plugins/Event/classes/RSVP.php

index 59cc07027877f6dc32226d4432eb9f96e6a6cd49..124094c291650c3a79d420c09dbfc810c852e834 100644 (file)
@@ -74,6 +74,9 @@ class RsvpAction extends FormAction
             } catch (NoResultException $e) {
                 // Notice already gone
                 $rsvp->delete();
+            } catch (Exception $e) {
+                // emergency cleanup in case database is screwed up
+                $rsvp->delete();
             }
             return _m('Cancelled RSVP');
         }
index d74ae081b476141ebbf03c55f16c2a3f0a01895f..d7f296f647cc5827e0ff00635149f93c3066b142 100644 (file)
@@ -249,9 +249,13 @@ class Happening extends Managed_DataObject
         $actobj->extra[] = array('location',
                                 array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
                                 $this->location);
-        $actobj->extra[] = array('url',
-                                array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
-                                $this->getUrl());
+        try {
+            $actobj->extra[] = array('url',
+                                    array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
+                                    $this->getUrl());
+        } catch (InvalidUrlException $e) {
+            // oh well, no URL for you!
+        }
 
         /* We don't use these ourselves, but we add them to be nice RSS/XML citizens */
         $actobj->extra[] = array('startdate',
index 3eba0e95bece65df81bb5f72821caf8febd3d2fd..1fec6c33a2e6da284298a69e5350be9bbee84455 100644 (file)
@@ -128,7 +128,7 @@ class RSVP extends Managed_DataObject
     static function saveActivityObject(Activity $act, Notice $stored)
     {
         $target = Notice::getByKeys(array('uri'=>$act->target->id));
-        common_debug(_ve('TARGET: '.$target));
+        common_debug('TARGET:'._ve($target));
         if (!ActivityUtils::compareTypes($target->getObjectType(), [ Happening::OBJECT_TYPE ])) {
             throw new ClientException('RSVP not aimed at a Happening');
         }
@@ -170,7 +170,7 @@ class RSVP extends Managed_DataObject
         $happening = $this->getEvent();
 
         $actobj = new ActivityObject();
-        $actobj->id = $rsvp->getUri();
+        $actobj->id = $this->getUri();
         $actobj->type = self::getObjectType();
         $actobj->title = $this->asString();
         $actobj->content = $this->asString();