r21953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21952‎ | r21953 | r21954 >
Date:13:41, 7 May 2007
Author:tstarling
Status:old
Tags:
Comment:
Compromise: don't reference log_id on MySQL.
Modified paths:
  • /trunk/phase3/includes/LogPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogPage.php
@@ -55,21 +55,27 @@
5656
5757 $dbw = wfGetDB( DB_MASTER );
5858 $uid = $wgUser->getID();
 59+ $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' );
5960
6061 $this->timestamp = $now = wfTimestampNow();
61 - $dbw->insert( 'logging',
62 - array(
63 - 'log_type' => $this->type,
64 - 'log_action' => $this->action,
65 - 'log_timestamp' => $dbw->timestamp( $now ),
66 - 'log_user' => $uid,
67 - 'log_namespace' => $this->target->getNamespace(),
68 - 'log_title' => $this->target->getDBkey(),
69 - 'log_comment' => $this->comment,
70 - 'log_params' => $this->params
71 - ), $fname
 62+ $data = array(
 63+ 'log_type' => $this->type,
 64+ 'log_action' => $this->action,
 65+ 'log_timestamp' => $dbw->timestamp( $now ),
 66+ 'log_user' => $uid,
 67+ 'log_namespace' => $this->target->getNamespace(),
 68+ 'log_title' => $this->target->getDBkey(),
 69+ 'log_comment' => $this->comment,
 70+ 'log_params' => $this->params
7271 );
7372
 73+ # log_id doesn't exist on Wikimedia servers yet, and it's a tricky
 74+ # schema update to do. Hack it for now to ignore the field on MySQL.
 75+ if ( !is_null( $log_id ) ) {
 76+ $data['log_id'] = $log_id;
 77+ }
 78+ $dbw->insert( 'logging', $data, $fname );
 79+
7480 # And update recentchanges
7581 if ( $this->updateRecentChanges ) {
7682 $titleObj = SpecialPage::getTitleFor( 'Log', $this->type );

Follow-up revisions

RevisionCommit summaryAuthorDate
r21968*define $newId, lost in update from r21953aaron19:41, 7 May 2007