} 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');
}
$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',
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');
}
$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();