Page MenuHomePhabricator

GlobalBlockingBlockedIpMsg hook passed a string instead of an array
Closed, ResolvedPublic

Description

Stack trace on beta:

[26-Sep-2013 08:03:52] Catchable fatal error: Argument 2 passed to wfRunHooks() must be an array, string given, called in /data/project/apache/common-local/php-master/extensions/GlobalBlocking/GlobalBlocking.class.php on line 79 and defined at /data/project/apache/common-local/php-master/includes/GlobalFunctions.php on line 3897
Server: i-0000031b
Method: GET
URL: http://simple.wikipedia.beta.wmflabs.org/w/index.php?title=User:Pipeo15&action=edit
Backtrace:
#0 /data/project/apache/common-local/php-master/includes/GlobalFunctions.php(3897): wfRunHooks()
#1 /data/project/apache/common-local/php-master/extensions/GlobalBlocking/GlobalBlocking.class.php(79): wfRunHooks('GlobalBlockingB...', 'globalblocking-...')
#2 /data/project/apache/common-local/php-master/extensions/GlobalBlocking/GlobalBlocking.class.php(23): GlobalBlocking::getUserBlockErrors(Object(User), 'XXX.XXX.XXX.XXX')
#3 [internal function]: GlobalBlocking::getUserPermissionsErrors(Object(Title), Object(User), 'edit', '')
#4 /data/project/apache/common-local/php-master/includes/Hooks.php(199): call_user_func_array('GlobalBlocking:...', Array)
#5 /data/project/apache/common-local/php-master/includes/GlobalFunctions.php(3898): Hooks::run('getUserPermissi...', Array)
#6 /data/project/apache/common-local/php-master/includes/Title.php(1843): wfRunHooks('getUserPermissi...', Array)
#7 /data/project/apache/common-local/php-master/includes/Title.php(2235): Title->checkPermissionHooks('edit', Object(User), Array, true, false)
#8 /data/project/apache/common-local/php-master/includes/Title.php(1717): Title->getUserPermissionsErrorsInternal('edit', Object(User), true)
#9 /data/project/apache/common-local/php-master/includes/EditPage.php(451): Title->getUserPermissionsErrors('edit', Object(User))
#10 /data/project/apache/common-local/php-master/includes/EditPage.php(384): EditPage->getEditPermissionErrors()
#11 /data/project/apache/common-local/php-master/includes/actions/EditAction.php(50): EditPage->edit()
#12 /data/project/apache/common-local/php-master/includes/Wiki.php(441): EditAction->show()
#13 /data/project/apache/common-local/php-master/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#14 /data/project/apache/common-local/php-master/includes/Wiki.php(591): MediaWiki->performRequest()
#15 /data/project/apache/common-local/php-master/includes/Wiki.php(460): MediaWiki->main()
#16 /data/project/apache/common-local/php-master/index.php(55): MediaWiki->run()
#17 /data/project/apache/common-local/w/index.php(3): require('/data/project/a...')
#18 {main}

The related code in GlobalBlocking extension:

// Allow site customization of blocked message.
$blockedIpMsg = 'globalblocking-ipblocked';
wfRunHooks( 'GlobalBlockingBlockedIpMsg', &$blockedIpMsg );

Probably caused by https://gerrit.wikimedia.org/r/#/c/84333/

  • return $result = array( 'globalblocking-ipblocked', + // Allow site customization of blocked message. + $blockedIpMsg = 'globalblocking-ipblocked'; + wfRunHooks( 'GlobalBlockingBlockedIpMsg', &$blockedIpMsg ); + return $result = array( $blockedIpMsg,

CCing Nemo Bis and Parent5446


Version: master
Severity: major

Details

Reference
bz54628

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:16 AM
bzimport added a project: GlobalBlocking.
bzimport set Reference to bz54628.
bzimport added a subscriber: Unknown Object (MLST).
hashar created this task.Sep 26 2013, 9:58 AM

The first occurrence of that backtrace on the beta cluster happened on [23-Sep-2013 04:29:21] UTC.

Strange, this worked on my test wiki. Guess I missed something.

Change 86107 had a related patch set uploaded by Parent5446:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86107

Change 86109 had a related patch set uploaded by Parent5446:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86109

Reedy added a comment.Sep 26 2013, 6:45 PM
  • Bug 54658 has been marked as a duplicate of this bug. ***

Change 86107 merged by jenkins-bot:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86107

Change 86109 merged by jenkins-bot:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86109

Change 86161 had a related patch set uploaded by Reedy:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86161

Change 86161 merged by jenkins-bot:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86161

Change 86291 had a related patch set uploaded by Reedy:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86291

Change 86291 merged by Chad:
Fix error in call to wfRunHooks()

https://gerrit.wikimedia.org/r/86291