r109689 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109688‎ | r109689 | r109690 >
Date:20:13, 21 January 2012
Author:krinkle
Status:ok
Tags:bug27930, core 
Comment:
[Action] Fix action=ajax
* Move Ajax stuff to before regular title/page action handling. Ajax actions circumvent most stuff and return early from the regular execution.
* Needed because getAction / Action-classes can't handle action=ajax properly, which isn't until MediaWiki::performAction
* Also undo's debug 'true' in the if-statement from r109688
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -547,20 +547,28 @@
548548
549549 wfProfileIn( __METHOD__ );
550550
551 - // Get title from request parameters,
552 - // is set on the fly by parseTitle the first time.
553 - $title = $this->getTitle();
554 - $action = $this->getAction();
555 - $wgTitle = $title;
 551+ $request = $this->context->getRequest();
556552
557553 // Send Ajax requests to the Ajax dispatcher.
558 - if ( $wgUseAjax && true ) {
 554+ if ( $wgUseAjax && $request->getVal( 'action', 'view' ) == 'ajax' ) {
 555+
 556+ // Set a dummy title, because $wgTitle == null might break things
 557+ $title = Title::makeTitle( NS_MAIN, 'AJAX' );
 558+ $this->context->setTitle( $title );
 559+ $wgTitle = $title;
 560+
559561 $dispatcher = new AjaxDispatcher();
560562 $dispatcher->performAction();
561563 wfProfileOut( __METHOD__ );
562564 return;
563565 }
564566
 567+ // Get title from request parameters,
 568+ // is set on the fly by parseTitle the first time.
 569+ $title = $this->getTitle();
 570+ $action = $this->getAction();
 571+ $wgTitle = $title;
 572+
565573 if ( $wgUseFileCache && $title->getNamespace() >= 0 ) {
566574 wfProfileIn( 'main-try-filecache' );
567575 if ( HTMLFileCache::useFileCache( $this->context ) ) {

Sign-offs

UserFlagDate
😂inspected16:23, 27 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109678Reinstate r109223 per CR + fixes...krinkle06:57, 21 January 2012
r109688[Wiki.php] Minor clean up...krinkle20:10, 21 January 2012

Status & tagging log