jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, but someone else must approve
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: Ic78e1b4b5f3cb3d252158e4cdd66ae12172905fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to