r46270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46269‎ | r46270 | r46271 >
Date:18:02, 26 January 2009
Author:mrzman
Status:resolved (Comments)
Tags:
Comment:
add mIsPreview and mIsSectionPreview to parserOptions, set in EditPage. patch by Brad Jorsch on bug 16854 (changes to Cite in next commit)
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOptions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/ParserOptions.php
@@ -33,6 +33,8 @@
3434 var $mExternalLinkTarget; # Target attribute for external links
3535
3636 var $mUser; # Stored user object, just used to initialise the skin
 37+ var $mIsPreview; # Parsing the page for a "preview" operation
 38+ var $mIsSectionPreview; # Parsing the page for a "preview" operation on a single section
3739
3840 function getUseTeX() { return $this->mUseTeX; }
3941 function getUseDynamicDates() { return $this->mUseDynamicDates; }
@@ -54,6 +56,8 @@
5557 function getEnableLimitReport() { return $this->mEnableLimitReport; }
5658 function getCleanSignatures() { return $this->mCleanSignatures; }
5759 function getExternalLinkTarget() { return $this->mExternalLinkTarget; }
 60+ function getIsPreview() { return $this->mIsPreview; }
 61+ function getIsSectionPreview() { return $this->mIsSectionPreview; }
5862
5963 function getSkin() {
6064 if ( !isset( $this->mSkin ) ) {
@@ -99,6 +103,8 @@
100104 function setTimestamp( $x ) { return wfSetVar( $this->mTimestamp, $x ); }
101105 function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); }
102106 function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); }
 107+ function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); }
 108+ function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); }
103109
104110 function __construct( $user = null ) {
105111 $this->initialiseFromUser( $user );
@@ -156,6 +162,8 @@
157163 $this->mEnableLimitReport = false;
158164 $this->mCleanSignatures = $wgCleanSignatures;
159165 $this->mExternalLinkTarget = $wgExternalLinkTarget;
 166+ $this->mIsPreview = false;
 167+ $this->mIsSectionPreview = false;
160168 wfProfileOut( $fname );
161169 }
162170 }
Index: trunk/phase3/includes/EditPage.php
@@ -1660,6 +1660,8 @@
16611661
16621662 $parserOptions = ParserOptions::newFromUser( $wgUser );
16631663 $parserOptions->setEditSection( false );
 1664+ $parserOptions->setIsPreview( true );
 1665+ $parserOptions->setIsSectionPreview( !is_null($this->section) && $this->section !== '' );
16641666
16651667 global $wgRawHtml;
16661668 if ( $wgRawHtml && !$this->mTokenOk ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r46271(bug 16854) Show an error message when a page has <ref> tags and no <referenc...mrzman18:02, 26 January 2009
r46401RELEASE-NOTES for r46270.mrzman23:15, 27 January 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45379(bug 16854) Provide explicit error when <references /> is omitted. Patch by B...demon18:59, 3 January 2009
r45499Reverting r45379 as per comment 5 on bug 16854, i.e. it doesn't work with sec...tstarling13:10, 7 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   22:09, 27 January 2009

Release notes?

#Comment by Brion VIBBER (talk | contribs)   23:20, 27 January 2009

added in r46401

Status & tagging log