r82088 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82087‎ | r82088 | r82089 >
Date:22:37, 13 February 2011
Author:btongminh
Status:resolved (Comments)
Tags:
Comment:
Further fixes for NewUserMessage: newusermessage contains the template name, so we don't need to substitute that page ourselves and have it substituted by the parser. Also fixed an {} that was being interpreted by PHP.
Modified paths:
  • /trunk/extensions/NewUserMessage/NewUserMessage.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php
@@ -80,16 +80,16 @@
8181 }
8282
8383 /**
84 - * Produce the text of the message.
 84+ * Produce the template that contains the text of the message.
8585 * @returns String
8686 */
8787 static function fetchText() {
88 - $text = self::fetchTemplateIfExists( wfMsg( 'newusermessage-template-body' ) );
 88+ $template = wfMsg( 'newusermessage-template-body' );
8989 // Fall back if necessary to the old template
90 - if ( !$text ) {
91 - $text = self::fetchTemplateIfExists( wfMsg( 'newusermessage-template' ) );
 90+ if ( !$template ) {
 91+ $template = wfMsg( 'newusermessage-template' );
9292 }
93 - return $text;
 93+ return $template;
9494 }
9595
9696 /**
@@ -124,9 +124,9 @@
125125 $substitute = wfMsgForContent( 'newusermessage-substitute' );
126126
127127 if ( $substitute ) {
128 - $str = "{{subst:{{$str}}}|realName=$realName|name=$name}}";
 128+ $str = '{{subst:' . "$str|realName=$realName|name=$name}}";
129129 } else {
130 - $str = "{{{$str}|realName=$realName|name=$name}}";
 130+ $str = '{{' . "$str|realName=$realName|name=$name}}";
131131 }
132132
133133 if ( $preparse ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r821511.17wmf1: MFT r78964, r79086, r79087, r79091, r82004, r82025, r82048, r82070,...catrope22:55, 14 February 2011
r85027MFT various extension fixes: r81713, r81742, r81743, r81908, r81966, r81969, ...demon18:23, 30 March 2011

Comments

#Comment by Nemo bis (talk | contribs)   08:44, 16 February 2011

I suppose this is related: the extension doesn't seem to be working, it's not substituting where it should (adding also two newlines and a timestamp) and adding the wrong template where it should: e.g. m:User talk:Yanicaracas and commons:User talk:Limaodopalmital11 (now I've redirected commons:Template:Welcome-body to the real template).

#Comment by Bryan (talk | contribs)   09:16, 16 February 2011

Yes it is, marking fixme.

#Comment by Bryan (talk | contribs)   19:02, 30 March 2011

Unfixme, was fixed in r83468.

#Comment by Krinkle (talk | contribs)   00:11, 10 June 2011

According to the documentation it should use Welcome-heading and Welcome-body in LQT mode and just "Welcome" in other environments. However it's still using Template:Welcome-body on Commons (which does not have LQT)


Also, there's two line breaks before and after the templates causing a gap on top of all pages. And a timestamp, which may or may not be good.

#Comment by Bryan (talk | contribs)   14:44, 13 June 2011

Hmmm LQT integration was lost somewhere along the way. Probably when I removed User::leaveNewUserMessage() from core.

Status & tagging log