r76925 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76924‎ | r76925 | r76926 >
Date:00:12, 18 November 2010
Author:pdhanda
Status:resolved (Comments)
Tags:
Comment:
Fixed link in revcontents-getcontents from r76353. Fixed the same link to point to the correct revision id
Modified paths:
  • /branches/chad-pre-wmf-merge/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /branches/chad-pre-wmf-merge/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: branches/chad-pre-wmf-merge/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -42,7 +42,7 @@
4343 'group-autoreview-member' => 'autochecked users',
4444 'grouppage-autoreview' => '{{ns:project}}:Autochecked users',
4545 'revcontents-error' => 'Unable to get content.',
46 - 'revcontents-getcontents' => '<a href="$1" >View this revision</a>',
 46+ 'revcontents-getcontents' => '[{{fullurl:$1|oldid=$2}} View this revision]',
4747 'revcontents-waiting' => 'Waiting for content',
4848 'revreview-hist-draft' => 'unchecked revision',
4949 'revreview-hist-pending' => 'pending revision',
Index: branches/chad-pre-wmf-merge/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -1820,12 +1820,11 @@
18211821 * This will be replaced with artice content using javascript and an api call.
18221822 */
18231823 public function addCustomHtml( OutputPage $out ) {
1824 - global $wgTitle, $wgScript, $wgRequest;
 1824+ global $wgTitle;
18251825 $this->load();
1826 - if ( $wgRequest->getVal( 'oldid' ) ) {
1827 - $oldId = $wgRequest->getVal( 'oldid' );
1828 - $oldRevisionUrl = $wgScript . '?title=' . $wgTitle . '&oldid=' . $oldId;
1829 - $out->addHTML( "<div id='mw-fr-revisioncontents'>" . wfMsg( 'revcontents-getcontents', $oldRevisionUrl ) . "</div>" );
 1826+ if ( $out->getRevisionId() ) {
 1827+ $oldRevisionLink = wfMsgExt( 'revcontents-getcontents', array( 'parseinline' ), $wgTitle, $out->getRevisionId() );
 1828+ $out->addHTML( "<div id='mw-fr-revisioncontents' class='plainlinks'>" . $oldRevisionLink . "</div>" );
18301829 }
18311830
18321831 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r76926Merged r76925 from branches/chad-pre-wmf-mergepdhanda00:15, 18 November 2010
r77089Follow-up r76925: cleanups per CR commentsaaron22:37, 21 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76353Better error handling. Fixed how css and js file are included. Followup to r7...pdhanda23:32, 8 November 2010

Comments

#Comment by Nikerabbit (talk | contribs)   09:07, 18 November 2010

I would have renamed the message, since any customizations would suddenly break now that parsing is changed. Could also use $wgOut->wrapWikiMsg(). Also, passing $wgTitle directly seems dangerous. It might break in older PHP versions that don't convert to string automatically.

#Comment by Aaron Schulz (talk | contribs)   22:27, 21 November 2010

No one has had time to customize :)

Yeah, I was thinking that the $wgTitle thing is ugly.

Status & tagging log