r25373 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25372‎ | r25373 | r25374 >
Date:19:04, 31 August 2007
Author:david
Status:old
Tags:
Comment:
Handle blank new messages.
Modified paths:
  • /branches/liquidthreads/extensions/LqtBaseView.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtBaseView.php
@@ -339,10 +339,10 @@
340340 $thread->commitRevision( Threads::CHANGE_EDITED_ROOT, $thread, $e->summary );
341341 }
342342
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 ) {
347347 $this->output->redirect( $this->title->getFullURL() . '#' . 'lqt_thread_' . $thread->id() );
348348 }
349349 }

Status & tagging log