Merge "Revert "Log the reason why revision->getContent() returns null""
[lhc/web/wiklou.git] / includes / logging / LogPage.php
index 3b200fa..28c1a87 100644 (file)
@@ -97,14 +97,13 @@ class LogPage {
                        'log_type' => $this->type,
                        'log_action' => $this->action,
                        'log_timestamp' => $dbw->timestamp( $now ),
-                       'log_user' => $this->doer->getId(),
-                       'log_user_text' => $this->doer->getName(),
                        'log_namespace' => $this->target->getNamespace(),
                        'log_title' => $this->target->getDBkey(),
                        'log_page' => $this->target->getArticleID(),
                        'log_params' => $this->params
                ];
-               $data += CommentStore::newKey( 'log_comment' )->insert( $dbw, $this->comment );
+               $data += CommentStore::getStore()->insert( $dbw, 'log_comment', $this->comment );
+               $data += ActorMigration::newMigration()->getInsertValues( $dbw, 'log_user', $this->doer );
                $dbw->insert( 'logging', $data, __METHOD__ );
                $newId = $dbw->insertId();
 
@@ -319,7 +318,7 @@ class LogPage {
         *
         * @param string $action One of '', 'block', 'protect', 'rights', 'delete',
         *   'upload', 'move', 'move_redir'
-        * @param Title $target Title object
+        * @param Title $target
         * @param string $comment Description associated
         * @param array $params Parameters passed later to wfMessage function
         * @param null|int|User $doer The user doing the action. null for $wgUser
@@ -327,8 +326,6 @@ class LogPage {
         * @return int The log_id of the inserted log entry
         */
        public function addEntry( $action, $target, $comment, $params = [], $doer = null ) {
-               global $wgContLang;
-
                if ( !is_array( $params ) ) {
                        $params = [ $params ];
                }
@@ -340,9 +337,6 @@ class LogPage {
                # Trim spaces on user supplied text
                $comment = trim( $comment );
 
-               # Truncate for whole multibyte characters.
-               $comment = $wgContLang->truncate( $comment, 255 );
-
                $this->action = $action;
                $this->target = $target;
                $this->comment = $comment;