jenkins-bot has submitted this change and it was merged. Change subject: Only show 'patrol' link if there is an RC entry ......................................................................
Only show 'patrol' link if there is an RC entry RecentChangesListener deliberately does not generate RC entries for imports. This avoids an error if there is no RC entry. Change-Id: I0c3b3262c42ce28f21acf7d864b462a1c5a3b1cd --- M includes/Formatter/RevisionViewFormatter.php 1 file changed, 10 insertions(+), 8 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Formatter/RevisionViewFormatter.php b/includes/Formatter/RevisionViewFormatter.php index 72c5f2f..9945a60 100644 --- a/includes/Formatter/RevisionViewFormatter.php +++ b/includes/Formatter/RevisionViewFormatter.php @@ -124,14 +124,16 @@ } $recentChange = $row->revision->getRecentChange(); - $user = $ctx->getUser(); - if ( ChangesList::isUnpatrolled( $recentChange, $user ) ) { - $links['markPatrolled'] = $this->urlGenerator->markRevisionPatrolledAction( - $title, - $workflowId, - $recentChange, - $user->getEditToken( $recentChange->getAttribute( 'rc_id' ) ) - ); + if ( $recentChange !== null ) { + $user = $ctx->getUser(); + if ( ChangesList::isUnpatrolled( $recentChange, $user ) ) { + $links['markPatrolled'] = $this->urlGenerator->markRevisionPatrolledAction( + $title, + $workflowId, + $recentChange, + $user->getEditToken( $recentChange->getAttribute( 'rc_id' ) ) + ); + } } return $links; -- To view, visit https://gerrit.wikimedia.org/r/217981 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c3b3262c42ce28f21acf7d864b462a1c5a3b1cd Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Mattflaschen <mflasc...@wikimedia.org> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Sbisson <sbis...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits