Manual talk:Hooks/ArticleSaveComplete

So, how to install this? just copy $wgHooks['ArticleSave'][] = 'fnMyHook'; to LocalSettings.php?--Alnokta 05:52, 22 April 2007 (UTC)

Missing parameter
The parameter 'revision' is missing from the declaration. From MW 1.11: Jean-Lou Dupont 23:39, 8 October 2007 (UTC)

Outdated
Some of the information seems to be outdated (for example, "$isminor" seems to have been replaced with "$minor_edit"?), could someone update it please? I would myself but I'm not sure about some of this stuff... hence why I'm looking it up. :P --NightKev 07:00, 12 February 2009 (UTC)
 * I also found that &$minoredit needed to be replaced with $minoredit. Tisane 09:08, 11 March 2010 (UTC)

Differences in parameter declaration
Why is there a difference in the way some of the parameters are declared. My question is because of a bug I had in one extension, where using the $revision parameter. I copied the declaration of the function for the hook from this page. When performing concurent edits on the same page this resulted in an error on a call on the $revision object, it was no longer available. Changing the declaration of $revision to &$revision (passing it by reference) fixed the problem. As I'm not a php-wizz, can anybody tell me if the declaration prototype of this hook on this page needs to be updated and more consistent. What should be the correct declaration, for which parameters, and is there a guideline?

--Carter040 11:31, 7 October 2009 (UTC)

$watchthis should not a reference
The model function declaration in the article states that  is passed as a reference. Actually a null value is passed, and defining a function for this hook with  will produce a PHP warning and cause the hook to fail with:


 * Parameter 6 to NotifyArticleSaved expected to be a reference, value given in /var/www/acawiki.org/www/includes/Hooks.php on line 133

--Nkinkade 19:23, 10 February 2011 (UTC)

PHP Warning: Missing argument 12 in extension that uses ArticleSaveComplete
Hi, we get an "PHP Warning: Missing argument 12" error message in the apache 2 error log in /var/log/httpd/error_log when calling an extension that is based on the ArticleSaveComplete hook. This extension worked without any error in MW 1.15.x, but when we upgraded to MW 1.18.1 resp. MW 1.19.1 we faced error messages like this:

In the myExtension.php:

In the myExtension.body.php:

The error seems to to refer to the &$redirect parameter. Searching for changes in the hook interface since MW 1.15.x did not show up any results...

Any hints are welcome...!

Thanks in advance!!

--Frank 14:45, 29 June 2012 (UTC)
 * It looks like  was taken out of there, and no one updated Manual:Hooks/ArticleSaveComplete to reflect the change. Here is what I'm currently seeing at WikiPage::doEdit:

wfRunHooks( 'ArticleSaveComplete', array( &$this, &$user, $text, $summary, $flags & EDIT_MINOR, null, null, &$flags, $revision, &$status, $baseRevId ) ); Leucosticte (talk) 06:45, 3 September 2012 (UTC)