Last modified: 2014-09-20 22:45:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70626, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68626 - Fatal error: Call to a member function getOption() on a non-object in extensions/BetaFeatures/BetaFeaturesHooks.php on line 115
Fatal error: Call to a member function getOption() on a non-object in extensi...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
BetaFeatures (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Aude
:
: 68958 (view as bug list)
Depends on:
Blocks: 65874
  Show dependency treegraph
 
Reported: 2014-07-26 18:39 UTC by Nemo
Modified: 2014-09-20 22:45 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nemo 2014-07-26 18:39:01 UTC
Just by installing the extension and not enabling any beta feature, AFAIK (long story: http://paste.debian.net/111811/ ).

$ php5 phpunit.php 

[...]

PHPUnit 3.7.37 by Sebastian Bergmann.

Configuration read from /srv/vagrant/mediawiki/tests/phpunit/suite.xml

[...]

...........................................................  2183 / 14398 ( 15%)
.....................FPHP Fatal error:  Call to a member function getOption() on a non-object in /srv/vagrant/mediawiki/extensions/BetaFeatures/BetaFeaturesHooks.php on line 115
PHP Stack trace:
PHP   1. {main}() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:0
PHP   2. MediaWikiPHPUnitCommand::main() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160
PHP   3. PHPUnit_TextUI_Command->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:176
PHP   5. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:350
PHP   6. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:709
PHP   7. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:709
PHP   8. PHPUnit_Framework_TestSuite->runTest() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:749
PHP   9. MediaWikiTestCase->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:779
PHP  10. PHPUnit_Framework_TestCase->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
PHP  11. PHPUnit_Framework_TestResult->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:783
PHP  12. PHPUnit_Framework_TestCase->runBare() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
PHP  13. PHPUnit_Framework_TestCase->runTest() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:838
PHP  14. ReflectionMethod->invokeArgs() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:988
PHP  15. UserTest->testEditCount() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:988
PHP  16. User->addToDatabase() /srv/vagrant/mediawiki/tests/phpunit/includes/UserTest.php:218
PHP  17. User->saveOptions() /srv/vagrant/mediawiki/includes/User.php:3615
PHP  18. wfRunHooks() /srv/vagrant/mediawiki/includes/User.php:4775
PHP  19. Hooks::run() /srv/vagrant/mediawiki/includes/GlobalFunctions.php:4031
PHP  20. call_user_func_array() /srv/vagrant/mediawiki/includes/Hooks.php:206
PHP  21. BetaFeaturesHooks::updateUserCounts() /srv/vagrant/mediawiki/includes/Hooks.php:206

Fatal error: Call to a member function getOption() on a non-object in /srv/vagrant/mediawiki/extensions/BetaFeatures/BetaFeaturesHooks.php on line 115

Call Stack:
    0.0005     252912   1. {main}() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:0
    2.4455   25291488   2. MediaWikiPHPUnitCommand::main() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160
    2.4456   25303960   3. PHPUnit_TextUI_Command->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
   44.9965  200894920   4. PHPUnit_TextUI_TestRunner->doRun() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:176
   45.0378  201215464   5. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:350
   45.7795  201217592   6. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:709
  445.1807  348383968   7. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:709
  445.6279  348769688   8. PHPUnit_Framework_TestSuite->runTest() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:749
  445.6279  348769688   9. MediaWikiTestCase->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:779
  445.6303  348769928  10. PHPUnit_Framework_TestCase->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
  445.6303  348769928  11. PHPUnit_Framework_TestResult->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:783
  445.6304  348770872  12. PHPUnit_Framework_TestCase->runBare() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
  445.6311  348794224  13. PHPUnit_Framework_TestCase->runTest() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:838
  445.6311  348794984  14. ReflectionMethod->invokeArgs() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:988
  445.6311  348795240  15. UserTest->testEditCount() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:988
  445.6315  348798392  16. User->addToDatabase() /srv/vagrant/mediawiki/tests/phpunit/includes/UserTest.php:218
  445.6575  348798392  17. User->saveOptions() /srv/vagrant/mediawiki/includes/User.php:3615
  445.6592  348835112  18. wfRunHooks() /srv/vagrant/mediawiki/includes/User.php:4775
  445.6592  348835160  19. Hooks::run() /srv/vagrant/mediawiki/includes/GlobalFunctions.php:4031
  445.6593  348836080  20. call_user_func_array() /srv/vagrant/mediawiki/includes/Hooks.php:206
  445.6593  348836520  21. BetaFeaturesHooks::updateUserCounts() /srv/vagrant/mediawiki/includes/Hooks.php:206
Comment 1 Bartosz Dziewoński 2014-07-26 18:41:34 UTC
Oh, I ran into that and investigated a bit before getting bored.

It's because a test is ran for a registered user with invalid username ("127.0.0.1", IIRC), and so BetaFeatures' hook that tries to recreate that user object blows up.

Why do we have a test that does such strange things, and where it is, is the point where I got bored and just disabled the extension before running tests.
Comment 2 Nemo 2014-07-26 18:48:14 UTC
Thanks MatmaRex.
Comment 3 db [inactive,noenotif] 2014-08-16 19:28:16 UTC
*** Bug 68958 has been marked as a duplicate of this bug. ***
Comment 4 Aude 2014-09-18 14:15:33 UTC
note, this happens w/o hhvm
Comment 5 Gerrit Notification Bot 2014-09-20 15:42:06 UTC
Change 161670 had a related patch set uploaded by Aude:
Fix edit count UserTest which incorrectly adds user to db

https://gerrit.wikimedia.org/r/161670
Comment 6 Gerrit Notification Bot 2014-09-20 22:30:56 UTC
Change 161670 merged by jenkins-bot:
UserTest: Fix edit count test which incorrectly added user to db

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links