[MediaWiki-commits] [Gerrit] Restore changes to WikiRevision that were lost in cdeba4cfc7c - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Restore changes to WikiRevision that were lost in cdeba4cfc7c .. Restore changes to WikiRevision that were lost in cdeba4cfc7c The commit cdeba4cfc7c unintentionally "reverted" part of commits 0623aeb922e and b14d581dab1. Change-Id: I19334bd6b871ab0555c6db873a67e9350114 --- M includes/import/WikiRevision.php 1 file changed, 13 insertions(+), 3 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php index 6c238cf..7476636 100644 --- a/includes/import/WikiRevision.php +++ b/includes/import/WikiRevision.php @@ -490,7 +490,7 @@ $prevId = $dbw->selectField( 'revision', 'rev_id', array( 'rev_page' => $pageId, - 'rev_timestamp <= ' . $dbw->timestamp( $this->timestamp ), + 'rev_timestamp <= ' . $dbw->addQuotes( $dbw->timestamp( $this->timestamp ) ), ), __METHOD__, array( 'ORDER BY' => array( @@ -534,6 +534,16 @@ function importLogItem() { $dbw = wfGetDB( DB_MASTER ); + + $user = User::newFromName( $this->getUser() ); + if ( $user ) { + $userId = intval( $user->getId() ); + $userText = $user->getName(); + } else { + $userId = 0; + $userText = $this->getUser(); + } + # @todo FIXME: This will not record autoblocks if ( !$this->getTitle() ) { wfDebug( __METHOD__ . ": skipping invalid {$this->type}/{$this->action} log time, timestamp " . @@ -566,8 +576,8 @@ 'log_type' => $this->type, 'log_action' => $this->action, 'log_timestamp' => $dbw->timestamp( $this->timestamp ), - 'log_user' => User::idFromName( $this->user_text ), - # 'log_user_text' => $this->user_text, + 'log_user' => $userId, + 'log_user_text' => $userText, 'log_namespace' => $this->getTitle()->getNamespace(), 'log_title' => $this->getTitle()->getDBkey(), 'log_comment' => $this->getComment(), -- To view, visit https://gerrit.wikimedia.org/r/262099 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19334bd6b871ab0555c6db873a67e9350114 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TTOGerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Restore changes to WikiRevision that were lost in cdeba4cfc7c - change (mediawiki/core)
TTO has uploaded a new change for review. https://gerrit.wikimedia.org/r/262099 Change subject: Restore changes to WikiRevision that were lost in cdeba4cfc7c .. Restore changes to WikiRevision that were lost in cdeba4cfc7c The commit cdeba4cfc7c unintentionally "reverted" part of commits 0623aeb922e and b14d581dab1. Change-Id: I19334bd6b871ab0555c6db873a67e9350114 --- M includes/import/WikiRevision.php 1 file changed, 13 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/99/262099/1 diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php index 6c238cf..7476636 100644 --- a/includes/import/WikiRevision.php +++ b/includes/import/WikiRevision.php @@ -490,7 +490,7 @@ $prevId = $dbw->selectField( 'revision', 'rev_id', array( 'rev_page' => $pageId, - 'rev_timestamp <= ' . $dbw->timestamp( $this->timestamp ), + 'rev_timestamp <= ' . $dbw->addQuotes( $dbw->timestamp( $this->timestamp ) ), ), __METHOD__, array( 'ORDER BY' => array( @@ -534,6 +534,16 @@ function importLogItem() { $dbw = wfGetDB( DB_MASTER ); + + $user = User::newFromName( $this->getUser() ); + if ( $user ) { + $userId = intval( $user->getId() ); + $userText = $user->getName(); + } else { + $userId = 0; + $userText = $this->getUser(); + } + # @todo FIXME: This will not record autoblocks if ( !$this->getTitle() ) { wfDebug( __METHOD__ . ": skipping invalid {$this->type}/{$this->action} log time, timestamp " . @@ -566,8 +576,8 @@ 'log_type' => $this->type, 'log_action' => $this->action, 'log_timestamp' => $dbw->timestamp( $this->timestamp ), - 'log_user' => User::idFromName( $this->user_text ), - # 'log_user_text' => $this->user_text, + 'log_user' => $userId, + 'log_user_text' => $userText, 'log_namespace' => $this->getTitle()->getNamespace(), 'log_title' => $this->getTitle()->getDBkey(), 'log_comment' => $this->getComment(), -- To view, visit https://gerrit.wikimedia.org/r/262099 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I19334bd6b871ab0555c6db873a67e9350114 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TTO___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits