From: Timo Tijhof Date: Fri, 27 Feb 2015 14:02:24 +0000 (+0000) Subject: Fix fatal "Call to setExpectation() on non-object" in MediaWiki::main() X-Git-Tag: 1.31.0-rc.0~12253^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=b1518ce2cc7bc8b90e72d2b02d16b2c15ff65aeb;p=lhc%2Fweb%2Fwiklou.git Fix fatal "Call to setExpectation() on non-object" in MediaWiki::main() Follows-up b403a757726e, 2762888e0d0ee50d. Caught by the qunit tests via Special:RunJobs. The test is still work-in-progress (T50002) but it's already paying off :) Change-Id: Idb37ecb97ff77950a981bfe10a46f27e532e1abb --- diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 9428d4992d..3b463ae4bd 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -489,12 +489,13 @@ class MediaWiki { $action = $this->getAction(); $wgTitle = $title; + $trxProfiler = Profiler::instance()->getTransactionProfiler(); + // Aside from rollback, master queries should not happen on GET requests. // Periodic or "in passing" updates on GET should use the job queue. if ( !$request->wasPosted() && in_array( $action, array( 'view', 'edit', 'history' ) ) ) { - $trxProfiler = Profiler::instance()->getTransactionProfiler(); $trxProfiler->setExpectation( 'masterConns', 0, __METHOD__ ); $trxProfiler->setExpectation( 'writes', 0, __METHOD__ ); } else {