MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/181178
Change subject: Ensure file page mobile views have the proper title in context
......................................................................
Ensure file page mobile views have the proper title in context
Bug: T78003
Change-Id: Ic78e1b4b5f3cb3d252158e4cdd66ae12172905fe
---
M includes/api/ApiMobileView.php
1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/78/181178/1
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index 5821b24..7e7a94f 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -598,11 +598,13 @@
private function getFilePage( Title $title ) {
//HACK: HACK: HACK:
wfProfileIn( __METHOD__ );
+ $context = new DerivativeContext( $this->getContext() );
+ $context->setTitle( $title );
+ $context->setOutput( new OutputPage( $context ) );
$page = new ImagePage( $title );
- $page->setContext( $this->getContext() );
+ $page->setContext( $context );
$page->view();
- global $wgOut;
- $html = $wgOut->getHTML();
+ $html = $context->getOutput()->getHTML();
wfProfileOut( __METHOD__ );
return $html;
}
--
To view, visit https://gerrit.wikimedia.org/r/181178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic78e1b4b5f3cb3d252158e4cdd66ae12172905fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits