Index: branches/liquidthreads/extensions/LqtPages.php |
— | — | @@ -362,9 +362,6 @@ |
363 | 363 | unset($content_actions['edit']); |
364 | 364 | unset($content_actions['viewsource']); |
365 | 365 | unset($content_actions['talk']); |
366 | | -/* unset($content_actions['history']); |
367 | | - unset($content_actions['watch']); |
368 | | - unset($content_actions['move']);*/ |
369 | 366 | if( array_key_exists( 'move', $content_actions ) && $this->thread ) { |
370 | 367 | $content_actions['move']['href'] = |
371 | 368 | SpecialPage::getPage('Movethread')->getTitle()->getFullURL() . '/' . |
— | — | @@ -374,9 +371,7 @@ |
375 | 372 | $content_actions['delete']['href'] = |
376 | 373 | SpecialPage::getPage('Deletethread')->getTitle()->getFullURL() . '/' . |
377 | 374 | $this->thread->title()->getPrefixedURL(); |
378 | | - } |
379 | | - |
380 | | - |
| 375 | + } |
381 | 376 | return true; |
382 | 377 | } |
383 | 378 | |
— | — | @@ -392,6 +387,10 @@ |
393 | 388 | $this->output->addHTML("There is no such revision of this thread."); |
394 | 389 | } |
395 | 390 | |
| 391 | + function showMissingThreadPage() { |
| 392 | + $this->output->addHTML("There is no such thread."); |
| 393 | + } |
| 394 | + |
396 | 395 | function __construct(&$output, &$article, &$title, &$user, &$request) { |
397 | 396 | |
398 | 397 | parent::__construct($output, $article, $title, $user, $request); |
— | — | @@ -403,10 +402,12 @@ |
404 | 403 | |
405 | 404 | } |
406 | 405 | $this->thread = $t; |
| 406 | + if( ! $t ) { |
| 407 | + return; // error reporting is handled in show(). this kinda sucks. |
| 408 | + } |
407 | 409 | |
408 | | - // TODO this is a holdover from the special page; not sure what's correct here. |
409 | | - // we now have a real true $this->article that makes some sense. |
410 | | - // but we still want to know about $t->article. |
| 410 | + // $this->article gets saved to thread_article, so we want it to point to the |
| 411 | + // subject page associated with the talkpage, always, not the permalink url. |
411 | 412 | $this->article = $t->article(); # for creating reply threads. |
412 | 413 | |
413 | 414 | } |
— | — | @@ -414,6 +415,11 @@ |
415 | 416 | function show() { |
416 | 417 | global $wgHooks; |
417 | 418 | $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs'); |
| 419 | + |
| 420 | + if( ! $this->thread ) { |
| 421 | + $this->showMissingThreadPage(); |
| 422 | + return false; |
| 423 | + } |
418 | 424 | |
419 | 425 | // Make a link back to the talk page, including the correct archive month. |
420 | 426 | // TODO this is obsolete. |
— | — | @@ -647,18 +653,12 @@ |
648 | 654 | function show() { |
649 | 655 | global $wgHooks; |
650 | 656 | $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs'); |
651 | | - |
652 | | -/* var_dump($this->article); |
653 | | - $t = Threads::withRoot( $this->article ); |
654 | | - $this->thread = $t; |
655 | | -*/ |
656 | | - // TODO this is a holdover from the special page; not sure what's correct here. |
657 | | - // we now have a real true $this->article that makes some sense. |
658 | | - // but we still want to know about $t->article. |
659 | | - // $this->article gets saved to thread_article, so we want it to point to the |
660 | | - // subject page associated with the talkpage, always, not the permalink url. |
661 | | -// $this->article = $t->article(); # for creating reply threads. |
662 | 657 | |
| 658 | + if( ! $this->thread ) { |
| 659 | + $this->showMissingThreadPage(); |
| 660 | + return false; |
| 661 | + } |
| 662 | + |
663 | 663 | $this->output->setSubtitle("Viewing a history listing."); |
664 | 664 | |
665 | 665 | $this->showThreadHeading($this->thread); |
— | — | @@ -704,6 +704,10 @@ |
705 | 705 | } |
706 | 706 | |
707 | 707 | function show() { |
| 708 | + if( ! $this->thread ) { |
| 709 | + $this->showMissingThreadPage(); |
| 710 | + return false; |
| 711 | + } |
708 | 712 | $this->showHistoryInfo(); |
709 | 713 | parent::show(); |
710 | 714 | return false; |