Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67309


Change subject: edit.php maintenance script not setting up context, just globals
......................................................................

edit.php maintenance script not setting up context, just globals

Was breaking one of Echo's hooks

Bug: 49271
Change-Id: Ie1b5f5bc4a672bcfff3c99b9a76b37c502c09985
---
M maintenance/edit.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/67309/1

diff --git a/maintenance/edit.php b/maintenance/edit.php
index 7fca651..7c24f0f 100644
--- a/maintenance/edit.php
+++ b/maintenance/edit.php
@@ -52,6 +52,8 @@
                $noRC = $this->hasOption( 'no-rc' );
 
                $wgUser = User::newFromName( $userName );
+               $context = RequestContext::getMain();
+               $context->setUser( $wgUser );
                if ( !$wgUser ) {
                        $this->error( "Invalid username", true );
                }
@@ -63,6 +65,7 @@
                if ( !$wgTitle ) {
                        $this->error( "Invalid title", true );
                }
+               $context->setTitle( $wgTitle );
 
                $page = WikiPage::factory( $wgTitle );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/67309
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1b5f5bc4a672bcfff3c99b9a76b37c502c09985
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>

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

Reply via email to