Last modified: 2012-10-17 22:19:02 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 T43098, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41098 - Call to undefined method Title::getType() in .../includes/job/JobQueueGroup.php
Call to undefined method Title::getType() in .../includes/job/JobQueueGroup.php
Status: VERIFIED FIXED
Product: MediaWiki
Classification: Unclassified
JobQueue (Other open bugs)
1.21.x
All All
: Unprioritized blocker (vote)
: ---
Assigned To: Nobody - You can work on this!
https://gerrit.wikimedia.org/r/#/c/13...
:
Depends on:
Blocks: 39480
  Show dependency treegraph
 
Reported: 2012-10-17 09:27 UTC by Niklas Laxström
Modified: 2012-10-17 22:19 UTC (History)
10 users (show)

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


Attachments

Description Niklas Laxström 2012-10-17 09:27:46 UTC
The recent refactoring broke some unit tests of Translate extension.

twn:/www/dev.translatewiki.net/w/extensions/Translate/tests (master)$ make
php ../../../tests/phpunit/phpunit.php .
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /www/dev.translatewiki.net/w/tests/phpunit/suite.xml

...............................................................  63 / 140 ( 45%)
.
Fatal error: Call to undefined method Title::getType() in /www/dev.translatewiki.net/w/includes/job/JobQueueGroup.php on line 90
make: *** [default] Error 255

Marking as blocker because this affects Translate extension development because it is integrated to Jenkins in Gerrit. It also prevents us to update translatewiki.net production due to fear it will break badly.

JobQueueGroup.php line 86 calls wfBacktrace()
Job.php line 163 calls JobQueueGroup->push()
MessageGroupStatesUpdaterJob.php line 24 calls Job->insert()
- line - calls MessageGroupStatesUpdaterJob::onChange()
Hooks.php line 253 calls call_user_func_array()
GlobalFunctions.php line 3811 calls Hooks::run()
TranslateEditAddons.php line 347 calls wfRunHooks()
- line - calls TranslateEditAddons::onSave()
Hooks.php line 253 calls call_user_func_array()
GlobalFunctions.php line 3811 calls Hooks::run()
WikiPage.php line 1897 calls wfRunHooks()
WikiPage.php line 1569 calls WikiPage->doEditContent()
MessageGroupStatesUpdaterJobTest.php line 118 calls WikiPage->doEdit()
- line - calls MessageGroupStatesUpdaterJobTest->testHooks()
TestCase.php line 942 calls ReflectionMethod->invokeArgs()
TestCase.php line 804 calls PHPUnit_Framework_TestCase->runTest()
TestResult.php line 649 calls PHPUnit_Framework_TestCase->runBare()
TestCase.php line 751 calls PHPUnit_Framework_TestResult->run()
MediaWikiTestCase.php line 87 calls PHPUnit_Framework_TestCase->run()
TestSuite.php line 772 calls MediaWikiTestCase->run()
TestSuite.php line 745 calls PHPUnit_Framework_TestSuite->runTest()
TestSuite.php line 705 calls PHPUnit_Framework_TestSuite->run()
TestRunner.php line 325 calls PHPUnit_Framework_TestSuite->run()
Command.php line 192 calls PHPUnit_TextUI_TestRunner->doRun()
MediaWikiPHPUnitCommand.php line 45 calls PHPUnit_TextUI_Command->run()
phpunit.php line 107 calls MediaWikiPHPUnitCommand::main()

Apparently it is trying to cast an object to array with catastrophic results.
Comment 1 Siebrand Mazeland 2012-10-17 10:14:09 UTC
Appears to be related to Gerrit change #13194 which does not have any BC considerations. Schema change is *required* after this patch set, even though, IIRC, new features with schema changes should not break things in core (the recent ContentHandler merge also *required* a schema change).

Adding Aaron, Asher, Daniel, Terry and Tim in CC because of their involvement in Gerrit change #13194, and Rob Lanphier from a schema change policy perspective.
Comment 2 Daniel Kinzler 2012-10-17 18:52:05 UTC
FYI: ContentHandler does not require a schema change, it has a compat mode (set $wgContentHandlerUseDB = false). This is what is being deployed on the WMF cluster. However, if you run update.php, it will change the schema (see bug 40854).
Comment 3 Aaron Schulz 2012-10-17 19:24:41 UTC
That backtrace seems useless, try running them with https://gerrit.wikimedia.org/r/#/c/28387/ to get a better one.
Comment 4 Siebrand Mazeland 2012-10-17 19:45:56 UTC
(In reply to comment #2)
> FYI: ContentHandler does not require a schema change, it has a compat mode (set
> $wgContentHandlerUseDB = false). This is what is being deployed on the WMF
> cluster. However, if you run update.php, it will change the schema (see bug
> 40854).

Daniel, wgContentHandlerUseDB is set to false by default of course so that updaters don't immediately have a broken wiki, right?
Comment 5 Chad H. 2012-10-17 21:03:26 UTC
It is now: https://gerrit.wikimedia.org/r/#/c/28445/
Comment 6 Aaron Schulz 2012-10-17 21:56:16 UTC
(In reply to comment #3)
> That backtrace seems useless, try running them with
> https://gerrit.wikimedia.org/r/#/c/28387/ to get a better one.

The trace is the same code path according to nikerabbit. Chad and I were confused be this but it makes sense technically:
"If an object is converted to an array, the result is an array whose elements are the object's properties. The keys are the member variable names, with a few notable exceptions: integer properties are unaccessible; private variables have the class name prepended to the variable name; protected variables have a '*' prepended to the variable name."

...thus it does NOT make an array with just that object (which PHP does do for primitives but not objects). This pattern is used in a lot of code so I well have to grep through it all to audit it later.

The fix for the job code is in https://gerrit.wikimedia.org/r/28450.
Comment 7 Aaron Schulz 2012-10-17 22:09:13 UTC
Merged. Also the other array type casting in includes/ looks OK.

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


Navigation
Links