r5949 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5948‎ | r5949 | r5950 >
Date:12:25, 17 October 2004
Author:jeluf
Status:old
Tags:
Comment:
Fixed editing of redirected pages.
Modified paths:
  • /branches/SCHEMA_WORK/phase3/includes/Article.php (modified) (history)
  • /branches/SCHEMA_WORK/phase3/includes/Database.php (modified) (history)

Diff [purge]

Index: branches/SCHEMA_WORK/phase3/includes/Article.php
@@ -513,26 +513,26 @@
514514 * @private
515515 */
516516 function loadLastEdit() {
517 - $this->loadContent();
518 - return;
519 - /*global $wgOut;
520 - wfDebugDieBacktrace( "Shouldn't the content do this?" );
 517+ ## $this->loadContent();
 518+ ## return;
 519+ global $wgOut;
 520+ ## wfDebugDieBacktrace( "Shouldn't the content do this?" );
521521 if ( -1 != $this->mUser ) return;
522522
523523 $fname = 'Article::loadLastEdit';
524524
525525 $dbr =& $this->getDB();
526 - $s = $dbr->getArray( 'cur',
527 - array( 'cur_user','cur_user_text','cur_timestamp', 'cur_comment','cur_minor_edit' ),
528 - array( 'cur_id' => $this->getID() ), $fname, $this->getSelectOptions() );
 526+ $s = $dbr->getArray( array( 'revision', 'page') ,
 527+ array( 'rev_user','rev_user_text','rev_timestamp', 'rev_comment','rev_minor_edit' ),
 528+ array( 'page_id' => $this->getID(), 'page_latest=rev_id' ), $fname, $this->getSelectOptions() );
529529
530530 if ( $s !== false ) {
531 - $this->mUser = $s->cur_user;
532 - $this->mUserText = $s->cur_user_text;
533 - $this->mTimestamp = wfTimestamp(TS_MW,$s->cur_timestamp);
534 - $this->mComment = $s->cur_comment;
535 - $this->mMinorEdit = $s->cur_minor_edit;
536 - }*/
 531+ $this->mUser = $s->rev_user;
 532+ $this->mUserText = $s->rev_user_text;
 533+ $this->mTimestamp = wfTimestamp(TS_MW,$s->rev_timestamp);
 534+ $this->mComment = $s->rev_comment;
 535+ $this->mMinorEdit = $s->rev_minor_edit;
 536+ }
537537 }
538538
539539 function getTimestamp() {
Index: branches/SCHEMA_WORK/phase3/includes/Database.php
@@ -536,7 +536,6 @@
537537 } else {
538538 $sql = "SELECT $vars $from $useIndex $tailOpts";
539539 }
540 - print "<pre><b>$fname</b>\n$sql</pre>";
541540 return $this->query( $sql, $fname );
542541 }
543542

Status & tagging log