X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FLogEntry.php;h=6587304ffb3f969007c9c4b443963f7474a73296;hb=e5ffb82fabc3411ac3f23f5ac7ebd49c923dc1cf;hp=e7095f0b399814c7ee69ea113fbae31355269a4a;hpb=2d250f636ae3bd88f9f221fea4a95f41cdfa60da;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index e7095f0b39..6587304ffb 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -170,19 +170,21 @@ class DatabaseLogEntry extends LogEntryBase { * @return array */ public static function getSelectQueryData() { - $tables = [ 'logging', 'user' ]; + $commentQuery = CommentStore::newKey( 'log_comment' )->getJoin(); + + $tables = [ 'logging', 'user' ] + $commentQuery['tables']; $fields = [ 'log_id', 'log_type', 'log_action', 'log_timestamp', 'log_user', 'log_user_text', 'log_namespace', 'log_title', // unused log_page - 'log_comment', 'log_params', 'log_deleted', + 'log_params', 'log_deleted', 'user_id', 'user_name', 'user_editcount', - ]; + ] + $commentQuery['fields']; $joins = [ // IPs don't have an entry in user table 'user' => [ 'LEFT JOIN', 'log_user=user_id' ], - ]; + ] + $commentQuery['joins']; return [ 'tables' => $tables, @@ -322,7 +324,7 @@ class DatabaseLogEntry extends LogEntryBase { } public function getComment() { - return $this->row->log_comment; + return CommentStore::newKey( 'log_comment' )->getComment( $this->row )->text; } public function getDeleted() { @@ -380,7 +382,9 @@ class RCDatabaseLogEntry extends DatabaseLogEntry { } public function getComment() { - return $this->row->rc_comment; + return CommentStore::newKey( 'rc_comment' ) + // Legacy because the row probably used RecentChange::selectFields() + ->getCommentLegacy( wfGetDB( DB_REPLICA ), $this->row )->text; } public function getDeleted() { @@ -437,8 +441,6 @@ class ManualLogEntry extends LogEntryBase { protected $legacy = false; /** - * Constructor. - * * @since 1.19 * @param string $type * @param string $subtype @@ -626,12 +628,12 @@ class ManualLogEntry extends LogEntryBase { 'log_namespace' => $this->getTarget()->getNamespace(), 'log_title' => $this->getTarget()->getDBkey(), 'log_page' => $this->getTarget()->getArticleID(), - 'log_comment' => $comment, 'log_params' => LogEntryBase::makeParamBlob( $params ), ]; if ( isset( $this->deleted ) ) { $data['log_deleted'] = $this->deleted; } + $data += CommentStore::newKey( 'log_comment' )->insert( $dbw, $comment ); $dbw->insert( 'logging', $data, __METHOD__ ); $this->id = $dbw->insertId();