Index: branches/liquidthreads/extensions/LqtExtension.php |
— | — | @@ -327,7 +327,7 @@ |
328 | 328 | if( $edit_type == 'editExisting' && $e->didSave ) { |
329 | 329 | $subject = $this->request->getVal('lqt_subject_field', ''); |
330 | 330 | if ( $subject && $subject != $thread->subjectWithoutIncrement() ) { |
331 | | - //$this->renameThread($thread, $subject); |
| 331 | + $this->renameThread($thread, $subject); |
332 | 332 | } |
333 | 333 | // this is unrelated to the subject change and is for all edits: |
334 | 334 | $thread->setRootRevision( Revision::newFromTitle($thread->root()->getTitle()) ); |
— | — | @@ -828,8 +828,13 @@ |
829 | 829 | return $res; |
830 | 830 | } |
831 | 831 | |
| 832 | + /* @return True if there are no threads to show, false otherwise. |
| 833 | + TODO is is somewhat bizarre. */ |
832 | 834 | function showSearchForm() { |
833 | 835 | $months = Threads::monthsWhereArticleHasThreads($this->article); |
| 836 | + if (count($months) == 0) { |
| 837 | + return true; |
| 838 | + } |
834 | 839 | |
835 | 840 | $use_dates = $this->request->getVal('lqt_archive_filter_by_date', null); |
836 | 841 | if ( $use_dates === null ) { |
— | — | @@ -889,6 +894,7 @@ |
890 | 895 | </form> |
891 | 896 | HTML |
892 | 897 | ); |
| 898 | + return false; |
893 | 899 | } |
894 | 900 | |
895 | 901 | function show() { |
— | — | @@ -898,7 +904,11 @@ |
899 | 905 | $this->output->setPageTitle( "Talk:" . $this->title->getText() ); // TODO non-main namespaces. |
900 | 906 | $this->addJSandCSS(); |
901 | 907 | |
902 | | - $this->showSearchForm(); |
| 908 | + $empty = $this->showSearchForm(); |
| 909 | + if ($empty) { |
| 910 | + $this->output->addHTML('<p>There are no threads in the archive.'); |
| 911 | + return; |
| 912 | + } |
903 | 913 | |
904 | 914 | $this->output->addHTML(<<<HTML |
905 | 915 | <p class="lqt_search_annotations">{$this->annotations}</p> |