r75961 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75960‎ | r75961 | r75962 >
Date:22:11, 3 November 2010
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Quick bandage for the critical liquid threads bug that prevented posting replies for most users.

Overwrite also $wgTitle, the article constructor changes are just ensuring that other weird bugs are not going to happen.
Modified paths:
  • /trunk/extensions/LiquidThreads/api/ApiThreadAction.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -309,11 +309,13 @@
310310 $thread = Threads::withId( intval( $operand ) );
311311
312312 // Yuck.
313 - global $wgOut, $wgRequest;
 313+ global $wgOut, $wgRequest, $wgTitle;
314314 $oldOut = $wgOut;
315315 $oldRequest = $wgRequest;
 316+ $oldTitle = $wgTitle;
316317 $wgOut = $this->output;
317318 $wgRequest = $this->request;
 319+ $wgTitle = $this->title;
318320
319321 $hookResult = wfRunHooks( 'LiquidThreadsDoInlineEditForm',
320322 array(
@@ -336,6 +338,7 @@
337339
338340 $wgOut = $oldOut;
339341 $wgRequest = $oldRequest;
 342+ $wgTitle = $oldTitle;
340343
341344 $this->output->setArticleBodyOnly( true );
342345 }
@@ -354,7 +357,7 @@
355358 $title = $talkpage->getTitle();
356359 }
357360 }
358 -
 361+
359362 $request->setVal( 'lqt_method', $method );
360363 $request->setVal( 'lqt_operand', $operand );
361364
Index: trunk/extensions/LiquidThreads/api/ApiThreadAction.php
@@ -24,7 +24,7 @@
2525 $threads = array( 'all' );
2626 } else {
2727 $title = Title::newFromText( $thread );
28 - $article = new Article( $title );
 28+ $article = new Article( $title, 0 );
2929 $threadObj = Threads::withRoot( $article );
3030 }
3131
@@ -165,7 +165,7 @@
166166 $newParent = Threads::withId( $newParent );
167167 } else {
168168 $title = Title::newFromText( $newParent );
169 - $article = new Article( $title );
 169+ $article = new Article( $title, 0 );
170170 $newParent = Threads::withRoot( $article );
171171 }
172172
@@ -214,7 +214,7 @@
215215 $this->dieUsage( 'The talkpage you specified is invalid, or does not ' .
216216 'have discussion threading enabled.', 'invalid-talkpage' );
217217 }
218 - $talkpage = new Article( $talkpageTitle );
 218+ $talkpage = new Article( $talkpageTitle, 0 );
219219
220220 // Check if we can post.
221221 if ( Thread::canUserPost( $wgUser, $talkpage ) !== true ) {
@@ -237,7 +237,7 @@
238238 $this->dieUsage( 'The subject you specified is not valid',
239239 'invalid-subject' );
240240 }
241 - $article = new Article( $title );
 241+ $article = new Article( $title, 0 );
242242
243243 // Check for text
244244 if ( empty( $params['text'] ) ) {
@@ -502,7 +502,7 @@
503503
504504 // Generate a reply title.
505505 $title = Threads::newReplyTitle( $replyTo, $wgUser );
506 - $article = new Article( $title );
 506+ $article = new Article( $title, 0 );
507507
508508 // Inform hooks what we're doing
509509 LqtHooks::$editTalkpage = $talkpage;
@@ -786,7 +786,7 @@
787787 }
788788
789789 if ( $talkpage ) {
790 - $talkpage = new Article( Title::newFromText( $talkpage ) );
 790+ $talkpage = new Article( Title::newFromText( $talkpage ), 0 );
791791 } else {
792792 $talkpage = null;
793793 }

Comments

#Comment by Hashar (talk | contribs)   22:17, 3 November 2010

Status & tagging log