r57928 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57927‎ | r57928 | r57929 >
Date:23:05, 19 October 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix master/slave issues with AJAX save
Modified paths:
  • /trunk/extensions/LiquidThreads/api/ApiThreadAction.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/Thread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/Thread.php
@@ -76,7 +76,11 @@
7777 $timestamp = wfTimestampNow();
7878
7979 $thread->setAuthor( $wgUser );
80 - $thread->setRoot( $root );
 80+
 81+ if ( is_object( $root ) )
 82+ $thread->setRoot( $root );
 83+ else
 84+ $thread->setRootId( $root );
8185 $thread->setSuperthread( $superthread );
8286 $thread->setArticle( $article );
8387 $thread->setSubject( $subject );
@@ -129,6 +133,11 @@
130134 $this->rootId = $article->getId();
131135 $this->root = $article;
132136 }
 137+
 138+ function setRootId( $article ) {
 139+ $this->rootId = $article;
 140+ $this->root = null;
 141+ }
133142
134143 function commitRevision( $change_type, $change_object = null, $reason = "" ) {
135144 $this->dieIfHistorical();
Index: trunk/extensions/LiquidThreads/api/ApiThreadAction.php
@@ -344,10 +344,7 @@
345345
346346 $articleId = $editResult['edit']['pageid'];
347347
348 - // Reload article data
349 - $article = Article::newFromId( $articleId );
350 -
351 - $thread = LqtView::postEditUpdates( 'new', null, $article, $talkpage,
 348+ $thread = LqtView::postEditUpdates( 'new', null, $articleId, $talkpage,
352349 $subject, $summary, null, $text );
353350
354351 $result = array(
@@ -435,10 +432,7 @@
436433
437434 $articleId = $editResult['edit']['pageid'];
438435
439 - // Reload article data
440 - $article = Article::newFromId( $articleId );
441 -
442 - $thread = LqtView::postEditUpdates( 'reply', $replyTo, $article, $talkpage,
 436+ $thread = LqtView::postEditUpdates( 'reply', $replyTo, $articleId, $talkpage,
443437 $subject, $summary, null, $text );
444438
445439 $result = array(
Index: trunk/extensions/LiquidThreads/lqt.js
@@ -101,7 +101,7 @@
102102 }
103103
104104 // Add AJAX save handler
105 - // $j(container).find('#wpSave').click( liquidThreads.handleAJAXSave );
 105+ $j(container).find('#wpSave').click( liquidThreads.handleAJAXSave );
106106 };
107107
108108 mwEditButtons = [];

Follow-up revisions

RevisionCommit summaryAuthorDate
r57929Merge r57928werdna23:06, 19 October 2009

Status & tagging log