Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -353,9 +353,24 @@ |
354 | 354 | $this->output->setArticleBodyOnly( true ); |
355 | 355 | } |
356 | 356 | |
| 357 | + /** |
| 358 | + * Workaround for bugs caused by r82686 |
| 359 | + * @param $request FauxRequest object to have session data injected into. |
| 360 | + */ |
| 361 | + static function fixFauxRequestSession( $request ) { |
| 362 | + foreach( $_SESSION as $k => $v ) { |
| 363 | + $request->setSessionData( $k, $v ); |
| 364 | + } |
| 365 | + } |
| 366 | + |
357 | 367 | static function getInlineEditForm( $talkpage, $method, $operand ) { |
358 | 368 | $output = new OutputPage; |
359 | 369 | $request = new FauxRequest( array() ); |
| 370 | + |
| 371 | + // Workaround for loss of session data when using FauxRequest |
| 372 | + global $wgRequest; |
| 373 | + self::fixFauxRequestSession( $request ); |
| 374 | + |
360 | 375 | $title = null; |
361 | 376 | |
362 | 377 | if ( $talkpage ) { |
— | — | @@ -377,6 +392,10 @@ |
378 | 393 | |
379 | 394 | $view->doInlineEditForm(); |
380 | 395 | |
| 396 | + foreach( $request->getSessionArray() as $k => $v ) { |
| 397 | + $wgRequest->setSessionData( $k, $v ); |
| 398 | + } |
| 399 | + |
381 | 400 | return $output->getHTML(); |
382 | 401 | } |
383 | 402 | |
Index: trunk/extensions/LiquidThreads/classes/ParserFunctions.php |
— | — | @@ -135,7 +135,8 @@ |
136 | 136 | $oldOut = $wgOut->getHTML(); |
137 | 137 | $wgOut->clearHTML(); |
138 | 138 | |
139 | | - $thread = Threads::withId( $thread ); |
| 139 | + $root = new Article( $title ); |
| 140 | + $thread = Threads::withRoot( $root ); |
140 | 141 | |
141 | 142 | $view = new LqtView( $wgOut, $article, $title, $wgUser, $wgRequest ); |
142 | 143 | |
Index: trunk/extensions/LiquidThreads/api/ApiThreadAction.php |
— | — | @@ -289,6 +289,7 @@ |
290 | 290 | } |
291 | 291 | |
292 | 292 | $editReq = new FauxRequest( $requestData, true ); |
| 293 | + LqtView::fixFauxRequestSession( $editReq ); |
293 | 294 | $internalApi = new ApiMain( $editReq, true ); |
294 | 295 | $internalApi->execute(); |
295 | 296 | |
— | — | @@ -408,6 +409,7 @@ |
409 | 410 | } |
410 | 411 | |
411 | 412 | $editReq = new FauxRequest( $requestData, true ); |
| 413 | + LqtView::fixFauxRequestSession( $editReq ); |
412 | 414 | $internalApi = new ApiMain( $editReq, true ); |
413 | 415 | $internalApi->execute(); |
414 | 416 | |
— | — | @@ -524,6 +526,7 @@ |
525 | 527 | } |
526 | 528 | |
527 | 529 | $editReq = new FauxRequest( $requestData, true ); |
| 530 | + LqtView::fixFauxRequestSession( $editReq ); |
528 | 531 | $internalApi = new ApiMain( $editReq, true ); |
529 | 532 | $internalApi->execute(); |
530 | 533 | |