Page MenuHomePhabricator

Echo Call to a member function getText() on a non-object
Closed, ResolvedPublic

Description

PHP Fatal error: Call to a member function getText() on a non-object in /usr/local/apache/common-local/php-1.20wmf9/extensions/Echo/includes/DiscussionParser.php on line 127

I thought this had been fixed already (?).. I seem to recall a discussion about it, and possibly a commit. But maybe not?


Version: unspecified
Severity: normal

Details

Reference
bz39085

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:00 AM
bzimport added a project: Notifications.
bzimport set Reference to bz39085.
bzimport added a subscriber: Unknown Object (MLST).
Reedy created this task.Aug 6 2012, 8:52 PM
Reedy added a comment.Aug 6 2012, 8:55 PM

(In reply to comment #0)

I thought this had been fixed already (?).. I seem to recall a discussion about
it, and possibly a commit. But maybe not?

Now I remember it was a replag related issue we did discuss, but couldn't fix.. i think

Reedy added a comment.Aug 7 2012, 6:56 PM

Broken in UnitTests..

PHP Fatal error: Call to a member function getText() on a non-object in /var/www/wiki/mediawiki/extensions/Echo/includes/DiscussionParser.php on line 127
PHP Stack trace:
PHP 1. {main}() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:0
PHP 2. MediaWikiPHPUnitCommand::main() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:103
PHP 3. PHPUnit_TextUI_Command->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:45
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP 7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP 8. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP 9. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP 10. MediaWikiTestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:772
PHP 11. PHPUnit_Framework_TestCase->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:75
PHP 12. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:751
PHP 13. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:649
PHP 14. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:804
PHP 15. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:942
PHP 16. WikiPageTest->testIsCountable() /var/www/wiki/mediawiki/core/tests/phpunit/includes/WikiPageTest.php:0
PHP 17. WikiPageTest->createPage() /var/www/wiki/mediawiki/core/tests/phpunit/includes/WikiPageTest.php:377
PHP 18. WikiPage->doEdit() /var/www/wiki/mediawiki/core/tests/phpunit/includes/WikiPageTest.php:66
PHP 19. wfRunHooks() /var/www/wiki/mediawiki/core/includes/WikiPage.php:1649
PHP 20. Hooks::run() /var/www/wiki/mediawiki/core/includes/GlobalFunctions.php:3907
PHP 21. call_user_func_array() /var/www/wiki/mediawiki/core/includes/Hooks.php:216
PHP 22. EchoHooks::onArticleSaved() /var/www/wiki/mediawiki/core/includes/Hooks.php:0
PHP 23. EchoDiscussionParser::generateEventsForRevision() /var/www/wiki/mediawiki/extensions/Echo/Hooks.php:187
PHP 24. EchoDiscussionParser::getChangeInterpretationForRevision() /var/www/wiki/mediawiki/extensions/Echo/includes/DiscussionParser.php:16

Fatal error: Call to a member function getText() on a non-object in /var/www/wiki/mediawiki/extensions/Echo/includes/DiscussionParser.php on line 127

Call Stack:

 0.0007     669480   1. {main}() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:0
 1.5627   22451344   2. MediaWikiPHPUnitCommand::main() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:103
 1.5628   22467104   3. PHPUnit_TextUI_Command->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:45
 5.4282  134693136   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192
 5.4522  135245680   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325
 5.4524  135247296   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
46.0815  206164768   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
54.1869  206979320   8. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
59.1305  207254032   9. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
59.1305  207254032  10. MediaWikiTestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:772
59.1346  207254288  11. PHPUnit_Framework_TestCase->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:75
59.1348  207254288  12. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:751
59.1393  207255872  13. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:649
59.1395  207297384  14. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:804
59.1396  207299992  15. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:942
59.1396  207300080  16. WikiPageTest->testIsCountable() /var/www/wiki/mediawiki/core/tests/phpunit/includes/WikiPageTest.php:0
59.1396  207300224  17. WikiPageTest->createPage() /var/www/wiki/mediawiki/core/tests/phpunit/includes/WikiPageTest.php:377
59.1401  207308360  18. WikiPage->doEdit() /var/www/wiki/mediawiki/core/tests/phpunit/includes/WikiPageTest.php:66
59.2938  207344808  19. wfRunHooks() /var/www/wiki/mediawiki/core/includes/WikiPage.php:1649
59.2938  207344808  20. Hooks::run() /var/www/wiki/mediawiki/core/includes/GlobalFunctions.php:3907
59.2950  207390664  21. call_user_func_array() /var/www/wiki/mediawiki/core/includes/Hooks.php:216
59.2950  207392560  22. EchoHooks::onArticleSaved() /var/www/wiki/mediawiki/core/includes/Hooks.php:0
59.3034  207676736  23. EchoDiscussionParser::generateEventsForRevision() /var/www/wiki/mediawiki/extensions/Echo/Hooks.php:187
59.3034  207676736  24. EchoDiscussionParser::getChangeInterpretationForRevision() /var/www/wiki/mediawiki/extensions/Echo/includes/DiscussionParser.php:16
		$prevRevision = Revision::newFromId( $revision->getParentId() );

		$changes = self::getMachineReadableDiff( $prevRevision->getText(), $revision->getText() );

I bet that happens when creating a new page…

That's when it's been happening to me, so yes.

Merged by Tychay.