r41095 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41094‎ | r41095 | r41096 >
Date:09:18, 21 September 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* An attempt to fix bug 11119
* (bug 11119) {{grammar}} broken in noarticletext(anon) when ui lang != content lang
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -210,7 +210,7 @@
211211 * @return Return the text of this revision
212212 */
213213 function getContent() {
214 - global $wgUser, $wgOut, $wgMessageCache;
 214+ global $wgOut, $wgMessageCache;
215215
216216 wfProfileIn( __METHOD__ );
217217
@@ -220,12 +220,11 @@
221221
222222 if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
223223 $wgMessageCache->loadAllMessages();
224 - $ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
 224+ $ret = wfMsgWeirdKey( $this->mTitle->getText() );
 225+ return "<div class='noarticletext'>\n$ret\n</div>";
225226 } else {
226 - $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
 227+ return $this->getNoSuchPageText();
227228 }
228 -
229 - return "<div class='noarticletext'>\n$ret\n</div>";
230229 } else {
231230 $this->loadContent();
232231 wfProfileOut( __METHOD__ );
@@ -233,6 +232,20 @@
234233 }
235234 }
236235
 236+ /*
 237+ * HACK HACK! We pre-parse them with parsemag to get GRAMMAR working right.
 238+ * It should be safe to do this and then do the full parse.
 239+ */
 240+ function getNoSuchPageText() {
 241+ global $wgUser;
 242+ if ( $wgUser->isLoggedIn() ) {
 243+ $text = wfMsgExt( 'noarticletext', 'parsemag' );
 244+ } else {
 245+ $text = wfMsgExt( 'noarticletextanon', 'parsemag' );
 246+ }
 247+ return "<div class='noarticletext'>\n$text\n</div>";
 248+ }
 249+
237250 /**
238251 * This function returns the text of a section, specified by a number ($section).
239252 * A section is text under a heading like == Heading == or \<h1\>Heading\</h1\>, or
Index: trunk/phase3/RELEASE-NOTES
@@ -213,6 +213,7 @@
214214 has been blocked more than 10 times. Patch by Matt Johnston.
215215 * (bug 12678) Skins don't show Upload link if the user isn't allowed to upload.
216216 * Fixed incorrect usage of DB_LAST in Special:Export. Deprecated DB_LAST.
 217+* 11119 {{grammar}} broken in noarticletext(anon) when ui lang != content lang
217218
218219 === API changes in 1.14 ===
219220

Follow-up revisions

RevisionCommit summaryAuthorDate
r41097Revert r41095, the bug is there because giving an error message as the return...tstarling09:47, 21 September 2008