r97206 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97205‎ | r97206 | r97207 >
Date:21:09, 15 September 2011
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Follow up r89706, building up on r97091.
I think this should fix the issues while
keeping bug 14404 solved.
We may need now a more advanced test than
ArticleTablesTest::testbug14404() thoigh.
Modified paths:
  • /trunk/phase3/includes/WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WikiPage.php
@@ -1984,7 +1984,7 @@
19851985 $edit->revid = $revid;
19861986 $edit->newText = $text;
19871987 $edit->pst = $this->preSaveTransform( $text, $user, $popts );
1988 - $edit->popts = $this->getParserOptions( true );
 1988+ $edit->popts = $this->makeParserOptions( new User );
19891989 $edit->output = $wgParser->parse( $edit->pst, $this->mTitle, $edit->popts, true, true, $revid );
19901990 $edit->oldText = $this->getRawText();
19911991
@@ -2563,13 +2563,11 @@
25642564 * Get parser options suitable for rendering the primary article wikitext
25652565 * @param $canonical boolean Determines that the generated options must not depend on user preferences (see bug 14404)
25662566 * @return mixed ParserOptions object or boolean false
2567 - * @deprecated since 1.19
25682567 */
2569 - public function getParserOptions( $canonical = false ) {
2570 - global $wgUser, $wgLanguageCode;
2571 - if ( !$this->mParserOptions || $canonical ) {
2572 - $user = !$canonical ? $wgUser : new User;
2573 - $this->mParserOptions = $this->makeParserOptions( $user );
 2568+ public function getParserOptions() {
 2569+ global $wgUser;
 2570+ if ( !$this->mParserOptions ) {
 2571+ $this->mParserOptions = $this->makeParserOptions( $wgUser );
25742572 }
25752573 // Clone to allow modifications of the return value without affecting cache
25762574 return clone $this->mParserOptions;

Follow-up revisions

RevisionCommit summaryAuthorDate
r97208Remove @param for argument removed in r97206.platonides21:29, 15 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36093Some tweaks to the {{int:...}} parser function:...ialex17:57, 9 June 2008
r36185Revert r36093 (bug 14404)....brion02:51, 11 June 2008
r79121Add failing test for bug 14404.platonides18:43, 28 December 2010
r79122Fix bug 14404. The articles are now always saved with the default options....platonides18:44, 28 December 2010
r89706Reinstate r79122 (fix for bug 14404), reverting r83868. The real bug seem to ...platonides22:28, 7 June 2011
r97091FU r89706: Cleaned up getParserOptions duplication problemsaaron19:57, 14 September 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   21:18, 15 September 2011

getParserOptions() docs not updated.

Status & tagging log