Index: trunk/extensions/LiquidThreads/classes/Thread.php |
— | — | @@ -76,7 +76,11 @@ |
77 | 77 | $timestamp = wfTimestampNow(); |
78 | 78 | |
79 | 79 | $thread->setAuthor( $wgUser ); |
80 | | - $thread->setRoot( $root ); |
| 80 | + |
| 81 | + if ( is_object( $root ) ) |
| 82 | + $thread->setRoot( $root ); |
| 83 | + else |
| 84 | + $thread->setRootId( $root ); |
81 | 85 | $thread->setSuperthread( $superthread ); |
82 | 86 | $thread->setArticle( $article ); |
83 | 87 | $thread->setSubject( $subject ); |
— | — | @@ -129,6 +133,11 @@ |
130 | 134 | $this->rootId = $article->getId(); |
131 | 135 | $this->root = $article; |
132 | 136 | } |
| 137 | + |
| 138 | + function setRootId( $article ) { |
| 139 | + $this->rootId = $article; |
| 140 | + $this->root = null; |
| 141 | + } |
133 | 142 | |
134 | 143 | function commitRevision( $change_type, $change_object = null, $reason = "" ) { |
135 | 144 | $this->dieIfHistorical(); |
Index: trunk/extensions/LiquidThreads/api/ApiThreadAction.php |
— | — | @@ -344,10 +344,7 @@ |
345 | 345 | |
346 | 346 | $articleId = $editResult['edit']['pageid']; |
347 | 347 | |
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, |
352 | 349 | $subject, $summary, null, $text ); |
353 | 350 | |
354 | 351 | $result = array( |
— | — | @@ -435,10 +432,7 @@ |
436 | 433 | |
437 | 434 | $articleId = $editResult['edit']['pageid']; |
438 | 435 | |
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, |
443 | 437 | $subject, $summary, null, $text ); |
444 | 438 | |
445 | 439 | $result = array( |
Index: trunk/extensions/LiquidThreads/lqt.js |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | } |
103 | 103 | |
104 | 104 | // Add AJAX save handler |
105 | | - // $j(container).find('#wpSave').click( liquidThreads.handleAJAXSave ); |
| 105 | + $j(container).find('#wpSave').click( liquidThreads.handleAJAXSave ); |
106 | 106 | }; |
107 | 107 | |
108 | 108 | mwEditButtons = []; |