Index: branches/liquidthreads/extensions/LqtBaseView.php |
— | — | @@ -339,10 +339,10 @@ |
340 | 340 | $thread->commitRevision( Threads::CHANGE_EDITED_ROOT, $thread, $e->summary ); |
341 | 341 | } |
342 | 342 | |
343 | | - // I have lost track of where the redirect happens, so I can't set a flag there until I find it. |
344 | | - // In the meantime, just check if somewhere somebody redirected. I'm afraid this might have |
345 | | - // unwanted side-effects. |
346 | | - if ( $this->output->getRedirect() != '' ) { |
| 343 | + // A redirect without $e->didSave will happen if the new text is blank (EditPage::attemptSave). |
| 344 | + // This results in a new Thread object not being created for replies and new discussions, |
| 345 | + // so $thread is null. In that case, just allow editpage to redirect back to the talk page. |
| 346 | + if ( $this->output->getRedirect() != '' && $thread ) { |
347 | 347 | $this->output->redirect( $this->title->getFullURL() . '#' . 'lqt_thread_' . $thread->id() ); |
348 | 348 | } |
349 | 349 | } |