Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -55,21 +55,27 @@ |
56 | 56 | |
57 | 57 | $dbw = wfGetDB( DB_MASTER ); |
58 | 58 | $uid = $wgUser->getID(); |
| 59 | + $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' ); |
59 | 60 | |
60 | 61 | $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 |
72 | 71 | ); |
73 | 72 | |
| 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 | + |
74 | 80 | # And update recentchanges |
75 | 81 | if ( $this->updateRecentChanges ) { |
76 | 82 | $titleObj = SpecialPage::getTitleFor( 'Log', $this->type ); |