From: Mikael Nordfeldth Date: Thu, 14 Jan 2016 18:14:24 +0000 (+0100) Subject: Minor fixes in Linkback plugin X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2af9de4f23b7e07582449f821383fac3aefb8378;p=quix0rs-gnu-social.git Minor fixes in Linkback plugin --- diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php index dbc8818843..64165199eb 100644 --- a/plugins/Linkback/LinkbackPlugin.php +++ b/plugins/Linkback/LinkbackPlugin.php @@ -79,11 +79,17 @@ class LinkbackPlugin extends Plugin $repeat = Notice::getByID($notice->repeat_of); $this->linkbackUrl($repeat->getUrl()); } else if(!empty($notice->reply_to)) { - $parent = $notice->getParent(); - $this->linkbackUrl($parent->getUrl()); + try { + $parent = $notice->getParent(); + $this->linkbackUrl($parent->getUrl()); + } catch (NoParentNoticeException $e) { + // can't link back to what we don't know (apparently parent notice disappeared from our db) + return true; + } } - $replyProfiles = Profile::multiGet('id', $notice->getReplies()); + // doubling up getReplies and getAttentionProfileIDs because we're not entirely migrated yet + $replyProfiles = Profile::multiGet('id', array_unique(array_merge($notice->getReplies(), $notice->getAttentionProfileIDs()))); foreach($replyProfiles->fetchAll('profileurl') as $profileurl) { $this->linkbackUrl($profileurl); }