r88606 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88605‎ | r88606 | r88607 >
Date:21:45, 22 May 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Followup r88591, mangle parseroptions instead
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -680,6 +680,10 @@
681681 $permaLink = $this->skin->link( $this->commentLink( $comment->id ), "#" );
682682 }
683683
 684+ $popts = $wgOut->parserOptions();
 685+ $popts->setEditSection( false );
 686+ $wgOut->parserOptions( $popts );
 687+
684688 return Xml::openElement( 'div',
685689 array(
686690 'class' => 'mw-codereview-comment',
@@ -696,7 +700,7 @@
697701 $this->commentReplyLink( $comment->id ) .
698702 '</div>' .
699703 '<div class="mw-codereview-comment-text">' .
700 - $wgOut->parse( "__NOEDITSECTION__" . $this->codeCommentLinkerWiki->link( $comment->text ) ) .
 704+ $wgOut->parse( $this->codeCommentLinkerWiki->link( $comment->text ) ) .
701705 '</div>' .
702706 $replyForm .
703707 '</div>';
@@ -713,7 +717,9 @@
714718 }
715719
716720 protected function commentReplyLink( $id ) {
717 - if ( !$this->canPostComments() ) return '';
 721+ if ( !$this->canPostComments() ) {
 722+ return '';
 723+ }
718724 $repo = $this->mRepo->getName();
719725 $rev = $this->mRev->getId();
720726 $self = SpecialPage::getTitleFor( 'Code', "$repo/$rev/reply/$id" );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88605* (bug 28091) CR comments can show Edit section links...reedy20:56, 22 May 2011

Comments

#Comment by Reedy (talk | contribs)   21:47, 22 May 2011
#Comment by Platonides (talk | contribs)   23:38, 22 May 2011

Should this restore the old parserOptions after using it?

#Comment by Reedy (talk | contribs)   23:39, 22 May 2011

It's not likely to be parsing any other articles... So should it matter? :/

#Comment by Platonides (talk | contribs)   23:45, 22 May 2011

In a generic environment, it should since it's a global setting, but I don't think it could be needed here. Thus the question.

Status & tagging log