Page MenuHomePhabricator

Special:MovePage throws MWException "Hook SMWParseData::onTitleMoveComplete has invalid call signature"
Closed, ResolvedPublic

Description

Moving a page on wikitech resulted in a fatal error after submission:

2015-12-03 14:52:26 silver labswiki exception ERROR: [71736016] /w/index.php?title=Special:MovePage&action=submit   MWException from line 220 of /srv/mediawiki/php-1.27.0-wmf.7/includes/Hooks.php: Detected bug in an extension! Hook SMWParseData::onTitleMoveComplete has invalid call signature; Parameter 3 to SMWParseData::onTitleMoveComplete() expected to be a reference, value given {"exception_id":"71736016"} 
[Exception MWException] (/srv/mediawiki/php-1.27.0-wmf.7/includes/Hooks.php:220) Detected bug in an extension! Hook SMWParseData::onTitleMoveComplete has invalid call signature; Parameter 3 to SMWParseData::onTitleMoveComplete() expected to be a reference, value given
  #0 /srv/mediawiki/php-1.27.0-wmf.7/includes/MovePage.php(376): Hooks::run(string, array)
  #1 [internal function]: MovePage->{closure}()
  #2 /srv/mediawiki/php-1.27.0-wmf.7/includes/db/Database.php(3310): call_user_func(Closure)
  #3 /srv/mediawiki/php-1.27.0-wmf.7/includes/db/Database.php(3562): DatabaseBase->runOnTransactionIdleCallbacks()
  #4 /srv/mediawiki/php-1.27.0-wmf.7/includes/db/loadbalancer/LoadBalancer.php(1050): DatabaseBase->commit(string, string)
  #5 [internal function]: LoadBalancer->commitMasterChanges()
  #6 /srv/mediawiki/php-1.27.0-wmf.7/includes/db/loadbalancer/LBFactory.php(194): call_user_func_array(array, array)
  #7 [internal function]: LBFactory->{closure}(LoadBalancer, string, array)
  #8 /srv/mediawiki/php-1.27.0-wmf.7/includes/db/loadbalancer/LBFactoryMulti.php(394): call_user_func_array(Closure, array)
  #9 /srv/mediawiki/php-1.27.0-wmf.7/includes/db/loadbalancer/LBFactory.php(195): LBFactoryMulti->forEachLB(Closure, array)
  #10 /srv/mediawiki/php-1.27.0-wmf.7/includes/db/loadbalancer/LBFactory.php(212): LBFactory->forEachLBCallMethod(string)
  #11 /srv/mediawiki/php-1.27.0-wmf.7/includes/MediaWiki.php(533): LBFactory->commitMasterChanges()
  #12 /srv/mediawiki/php-1.27.0-wmf.7/includes/MediaWiki.php(709): MediaWiki->doPreOutputCommit()
  #13 /srv/mediawiki/php-1.27.0-wmf.7/includes/MediaWiki.php(506): MediaWiki->main()
  #14 /srv/mediawiki/php-1.27.0-wmf.7/index.php(43): MediaWiki->run()
  #15 /srv/mediawiki/w/index.php(3): require(string)
  #16 {main}

It seems the main action (renaming the page in the database) did go through, but it's likely that other secondary updates or notifications maybe broken.

Event Timeline

Krinkle created this task.Dec 3 2015, 2:56 PM
Krinkle updated the task description. (Show Details)
Krinkle raised the priority of this task from to Unbreak Now!.
Krinkle added a subscriber: Krinkle.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 3 2015, 2:56 PM
Krinkle set Security to None.
Restricted Application added a project: Cloud-Services. · View Herald TranscriptDec 3 2015, 2:58 PM
mwjames added a subscriber: mwjames.Dec 3 2015, 4:49 PM

I added a similar issue with https://phabricator.wikimedia.org/T118683 but I have yet to see a response.

Reedy added a subscriber: Reedy.Dec 3 2015, 8:33 PM
		$params = array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason );
		$dbw->onTransactionIdle( function () use ( $params ) {
			Hooks::run( 'TitleMoveComplete', $params );
		} );
static public function onTitleMoveComplete( &$old_title, &$new_title, &$user, $pageid, $redirid ) {
        smwfGetStore()->changeTitle( $old_title, $new_title, $pageid, $redirid );
        return true; // always return true, in order not to stop MW's hook processing!
}

Both are references?

bd808 added a comment.Dec 3 2015, 11:17 PM
		$params = array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason );
		$dbw->onTransactionIdle( function () use ( $params ) {
			Hooks::run( 'TitleMoveComplete', $params );
		} );
static public function onTitleMoveComplete( &$old_title, &$new_title, &$user, $pageid, $redirid ) {
        smwfGetStore()->changeTitle( $old_title, $new_title, $pageid, $redirid );
        return true; // always return true, in order not to stop MW's hook processing!
}

Both are references?

Sounds like https://secure.php.net/manual/en/function.call-user-func-array.php#91503

bd808 added a comment.Dec 11 2015, 3:04 AM

The removal of the custom error handler for Hooks::run() is in 1.27.0-wmf.8 which should be active on all wikis now. I tested a page move on wikitech and could not recreate the error: https://wikitech.wikimedia.org/w/index.php?title=User:BryanDavis/Verify_T120218&action=history

bd808 assigned this task to ori.Dec 11 2015, 3:05 AM
bd808 closed this task as Resolved.