Yurik has uploaded a new change for review.
https://gerrit.wikimedia.org/r/198290
Change subject: In phpunit, mobile frontend crashes
......................................................................
In phpunit, mobile frontend crashes
PHP Fatal error: Call to a member function getFullUrl() on a non-object in
/vagrant/mediawiki/extensions/MobileFrontend/includes/MobileFrontend.hooks.php
on line 643
Stack trace:
1. {main}() /vagrant/mediawiki/tests/phpunit/phpunit.php:0
2. PHPUnit_TextUI_Command::main()
/vagrant/mediawiki/tests/phpunit/phpunit.php:239
3. PHPUnit_TextUI_Command->run()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php:104
4. PHPUnit_TextUI_TestRunner->doRun()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php:152
5. PHPUnit_Framework_TestSuite->run()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:398
6. MediaWikiTestCase->run()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:716
7. PHPUnit_Framework_TestCase->run()
/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:132
8. PHPUnit_Framework_TestResult->run()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php:693
9. PHPUnit_Framework_TestCase->runBare()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestResult.php:609
10. PHPUnit_Framework_TestCase->runTest()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php:737
11. ReflectionMethod->invokeArgs()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php:860
12. ApiQueryLists->testMultipleLists()
/vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php:860
13. ApiQueryLists->allTests()
/vagrant/mediawiki/extensions/Gather/tests/phpunit/api/ApiQueryLists.php:117
14. ApiQueryLists->updateList()
/vagrant/mediawiki/extensions/Gather/tests/phpunit/api/ApiQueryLists.php:145
15. ApiTestCase->doApiRequest()
/vagrant/mediawiki/extensions/Gather/tests/phpunit/api/ApiQueryLists.php:456
16. ApiMain->execute()
/vagrant/mediawiki/tests/phpunit/includes/api/ApiTestCase.php:115
17. ApiMain->executeAction() /vagrant/mediawiki/includes/api/ApiMain.php:365
18. ApiHelp->execute() /vagrant/mediawiki/includes/api/ApiMain.php:1041
19. OutputPage->output() /vagrant/mediawiki/includes/api/ApiHelp.php:54
20. Hooks::run() /vagrant/mediawiki/includes/OutputPage.php:2283
21. call_user_func_array() /vagrant/mediawiki/includes/Hooks.php:209
22. MobileFrontendHooks::onBeforePageDisplay()
/vagrant/mediawiki/includes/Hooks.php:209
Change-Id: Ie9aefadd424f24991bcd4545d06f2735667475a8
---
M includes/MobileFrontend.hooks.php
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/90/198290/1
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 28826f1..f206ddc 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -640,7 +640,7 @@
// and $wgMFNoindexPages needs to be true
// add alternate link to desktop sites - bug T91183
if ( $mfMobileUrlTemplate && $mfNoIndexPages ) {
- $desktopUrl = $context->getTitle()->getFullUrl();
+ $desktopUrl = $title->getFullUrl();
$out->addHeadItem(
'mobilelink',
Html::element(
@@ -666,7 +666,7 @@
'link',
array(
'rel' => 'canonical',
- 'href' =>
$context->getTitle()->getFullUrl(),
+ 'href' => $title->getFullUrl(),
)
)
);
--
To view, visit https://gerrit.wikimedia.org/r/198290
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9aefadd424f24991bcd4545d06f2735667475a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits