X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FLinkback%2FLinkbackPlugin.php;h=06c49b0809ae90baa503e02eec304d32f0d3ffdb;hb=722ff4d9c0cc47b5dda181136e03166eae712e87;hp=dbc88188439e9be3a73eade4f7215867dd727c74;hpb=99da1ebe41059b04e10e019bd81ebbbce0799787;p=quix0rs-gnu-social.git diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php index dbc8818843..06c49b0809 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); } @@ -331,7 +337,7 @@ class LinkbackPlugin extends Plugin $versions[] = array('name' => 'Linkback', 'version' => LINKBACKPLUGIN_VERSION, 'author' => 'Evan Prodromou', - 'homepage' => 'http://status.net/wiki/Plugin:Linkback', + 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Linkback', 'rawdescription' => // TRANS: Plugin description. _m('Notify blog authors when their posts have been linked in '.