r66675 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66674‎ | r66675 | r66676 >
Date:02:12, 20 May 2010
Author:mah
Status:resolved (Comments)
Tags:
Comment:
* Since it makes sense (to me :) to make the arguments for the two UserMessage hooks more uniform, do it.
* Document these hooks in doc/hooks.txt
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -263,6 +263,16 @@
264264 $user: the User object that was created. (Parameter added in 1.7)
265265 $byEmail: true when account was created "by email" (added in 1.12)
266266
 267+‘AfterUserMessage': After a user message has been left, this hook is
 268+called to take care of any cleanup.
 269+$user: The user who we left the message for.
 270+$article: The article the message was left on.
 271+$subject: The subject of the message
 272+$text: The text of the message.
 273+$signature: The signature we used.
 274+$summary: The edit summary.
 275+$editor: The editor that performed the edit.
 276+
267277 'AjaxAddScript': Called in output page just before the initialisation
268278 of the javascript ajax engine. The hook is only called when ajax
269279 is enabled ( $wgUseAjax = true; ).
@@ -1327,6 +1337,16 @@
13281338
13291339 'SetupAfterCache': Called in Setup.php, after cache objects are set
13301340
 1341+‘SetupUserMessageArticle': Called in User::leaveUserMessage() after
 1342+before anything has been posted to the article.
 1343+$user: The user who we left the message for.
 1344+&$article: The article that will be posted to.
 1345+$subject: The subject of the message
 1346+$text: The text of the message.
 1347+$signature: The signature we used.
 1348+$summary: The edit summary.
 1349+$editor: The editor that performed the edit.
 1350+
13311351 'ShowMissingArticle': Called when generating the output for a non-existent page
13321352 $article: The article object corresponding to the page
13331353
Index: trunk/phase3/includes/User.php
@@ -3777,7 +3777,7 @@
37783778
37793779 $article = new Article( $this->getTalkPage() );
37803780 wfRunHooks( 'SetupUserMessageArticle',
3781 - array( &$article, $subject, $this, $editor ) );
 3781+ array( $this, &$article, $subject, $text, $signature, $summary, $editor ) );
37823782
37833783 $flags = $article->checkFlags( $flags );
37843784
@@ -3798,7 +3798,7 @@
37993799 // Set newtalk with the right user ID
38003800 $this->setNewtalk( true );
38013801 wfRunHooks( 'AfterUserMessage',
3802 - array( $this, $article, $summary, $signature, $editor, $text ) );
 3802+ array( $this, $article, $summary, $text, $signature, $summary, $editor ) );
38033803 $dbw->commit();
38043804 } else {
38053805 // The article was concurrently created

Follow-up revisions

RevisionCommit summaryAuthorDate
r66717re r66675 fix typomah00:57, 21 May 2010
r81040* Whitespace fixups...mah17:48, 26 January 2011

Comments

#Comment by Platonides (talk | contribs)   22:26, 20 May 2010

What time is called after before?

#Comment by MarkAHershberger (talk | contribs)   00:59, 21 May 2010
P fixed in r66717
#Comment by RobLa-WMF (talk | contribs)   05:41, 26 January 2011

Why is $summary being passed in as the third parameter to AfterUserMessage? Shouldn't that be $subject?

#Comment by MarkAHershberger (talk | contribs)   17:49, 26 January 2011

Good catch! r81040

#Comment by RobLa-WMF (talk | contribs)   19:46, 26 January 2011

Giving this one to Chad since he's reviewing r66438 already

#Comment by 😂 (talk | contribs)   21:44, 6 February 2011

This commit by itself is fine with the followups. I'm leaving a full review of this in r66438.

Status & tagging log