Index: trunk/extensions/LiquidThreads/classes/LqtHistoricalThread.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | $this->editedness = $t->editedness; |
26 | 26 | |
27 | 27 | $this->replies = array(); |
28 | | - foreach ( $t->replies as $r ) { |
| 28 | + foreach ( $t->replies() as $r ) { |
29 | 29 | $this->replies[] = new HistoricalThread( $r ); |
30 | 30 | } |
31 | 31 | } |
Index: trunk/extensions/LiquidThreads/classes/LqtView.php |
— | — | @@ -417,10 +417,14 @@ |
418 | 418 | // This results in a new Thread object not being created for replies and new discussions, |
419 | 419 | // so $thread is null. In that case, just allow editpage to redirect back to the talk page. |
420 | 420 | if ( $this->output->getRedirect() != '' && $thread ) { |
421 | | - $this->output->redirect( $this->title->getFullURL() . '#' . 'lqt_thread_' . $thread->id() ); |
| 421 | + $redirectTitle = clone $this->title; |
| 422 | + $redirectTitle->setFragment( '#'.$this->anchorName( $thread ) ); |
| 423 | + $this->output->redirect( $this->title->getFullURL() ); |
422 | 424 | } else if ( $this->output->getRedirect() != '' && $edit_applies_to ) { |
423 | 425 | // For summaries: |
424 | | - $this->output->redirect( $edit_applies_to->title()->getFullURL() . '#' . 'lqt_thread_' . $edit_applies_to->id() ); |
| 426 | + $redirectTitle = clone $edit_applies_to->title(); |
| 427 | + $redirectTitle->setFragment( '#'.$this->anchorName( $edit_applies_to ) ); |
| 428 | + $this->output->redirect( $redirectTitle->getFullURL() ); |
425 | 429 | } |
426 | 430 | } |
427 | 431 | |
Index: trunk/extensions/LiquidThreads/classes/LqtThread.php |
— | — | @@ -426,9 +426,12 @@ |
427 | 427 | // Update: this doesn't work for some reason, but why do we update the replies array |
428 | 428 | // in the first place after creating a new reply? |
429 | 429 | $new_array = array(); |
430 | | - foreach ( $this->replies as $r ) |
431 | | - $new_array[] = $r; |
432 | | - $this->replies = $new_array; |
| 430 | + |
| 431 | + if( $this->replies ) { |
| 432 | + foreach ( $this->replies as $r ) |
| 433 | + $new_array[] = $r; |
| 434 | + $this->replies = $new_array; |
| 435 | + } |
433 | 436 | } |
434 | 437 | |
435 | 438 | /* |