r26427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26426‎ | r26427 | r26428 >
Date:05:57, 5 October 2007
Author:david
Status:old
Tags:
Comment:
History attribution and timestamp bug believed to be fixed for good.
Modified paths:
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtModel.php
@@ -288,7 +288,7 @@
289289 return Threads::where($where);
290290 }
291291
292 - private function bumpRevisionsOnAncestors($change_type, $change_object, $change_reason) {
 292+ private function bumpRevisionsOnAncestors($change_type, $change_object, $change_reason, $timestamp) {
293293 global $wgUser; // TODO global.
294294
295295 $this->revisionNumber += 1;
@@ -299,12 +299,16 @@
300300 $this->changeUserText = $wgUser->getName();
301301
302302 if( $this->hasSuperthread() )
303 - $this->superthread()->bumpRevisionsOnAncestors($change_type, $change_object, $change_reason);
 303+ $this->superthread()->bumpRevisionsOnAncestors($change_type, $change_object, $change_reason, $timestamp);
304304 $dbr =& wfGetDB( DB_MASTER );
305305 $res = $dbr->update( 'thread',
306306 /* SET */ array('thread_revision' => $this->revisionNumber,
307307 'thread_change_type'=>$this->changeType,
308 - 'thread_change_object'=>$this->changeObject),
 308+ 'thread_change_object'=>$this->changeObject,
 309+ 'thread_change_comment' => $this->changeComment,
 310+ 'thread_change_user' => $this->changeUser,
 311+ 'thread_change_user_text' => $this->changeUserText,
 312+ 'thread_timestamp' => $timestamp),
309313 /* WHERE */ array( 'thread_id' => $this->id ),
310314 __METHOD__);
311315 }
@@ -327,15 +331,15 @@
328332
329333 function commitRevision($change_type, $change_object = null, $reason = "") {
330334 global $wgUser; // TODO global.
331 -
 335+ /*
332336 $this->changeComment = $reason;
333337 $this->changeUser = $wgUser->getID();
334338 $this->changeUserText = $wgUser->getName();
335 -
 339+ */
336340 // TODO open a transaction.
337341 HistoricalThread::create( $this->double, $change_type, $change_object );
338342
339 - $this->bumpRevisionsOnAncestors($change_type, $change_object, $reason);
 343+ $this->bumpRevisionsOnAncestors($change_type, $change_object, $reason, wfTimestampNow());
340344 self::setChangeOnDescendents($this->topmostThread(), $change_type, $change_object);
341345
342346 /* SCHEMA changes must be reflected here. */
@@ -346,15 +350,15 @@
347351 'thread_path' => $this->path,
348352 'thread_type' => $this->type,
349353 'thread_summary_page' => $this->summaryId,
350 - 'thread_timestamp' => wfTimestampNow(),
351 - 'thread_revision' => $this->revisionNumber,
 354+// 'thread_timestamp' => wfTimestampNow(),
 355+// 'thread_revision' => $this->revisionNumber,
352356 'thread_article_namespace' => $this->articleNamespace,
353357 'thread_article_title' => $this->articleTitle,
354 - 'thread_change_type' => $this->changeType,
355 - 'thread_change_object' => $this->changeObject,
356 - 'thread_change_comment' => $this->changeComment,
357 - 'thread_change_user' => $this->changeUser,
358 - 'thread_change_user_text' => $this->changeUserText,
 358+// 'thread_change_type' => $this->changeType,
 359+// 'thread_change_object' => $this->changeObject,
 360+// 'thread_change_comment' => $this->changeComment,
 361+// 'thread_change_user' => $this->changeUser,
 362+// 'thread_change_user_text' => $this->changeUserText,
359363 ),
360364 /* WHERE */ array( 'thread_id' => $this->id, ),
361365 __METHOD__);

Status & tagging log