Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -367,8 +367,14 @@ |
368 | 368 | $article = $thread->root(); |
369 | 369 | } |
370 | 370 | |
371 | | - LqtHooks::$editTalkpage = $edit_type == 'new' |
372 | | - ? $this->article : $edit_applies_to->article(); |
| 371 | + $talkpage = $this->article; |
| 372 | + if ( $thread ) { |
| 373 | + $talkpage = $thread->article(); |
| 374 | + } elseif ( $edit_applies_to ) { |
| 375 | + $talkpage = $edit_applies_to->article(); |
| 376 | + } |
| 377 | + |
| 378 | + LqtHooks::$editTalkpage = $talkpage; |
373 | 379 | LqtHooks::$editArticle = $article; |
374 | 380 | LqtHooks::$editThread = $thread; |
375 | 381 | LqtHooks::$editType = $edit_type; |