Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/262862
Change subject: Revert "LogEntry: Make associated rev id persistent (store in logging and log_search)" ...................................................................... Revert "LogEntry: Make associated rev id persistent (store in logging and log_search)" This reverts commit f66ff602447c200eef76cad55f195ff6c11954aa, which breaks parserTests. Change-Id: I107036b9486d049638d4c93aab19aaafcf1d66b6 --- M includes/filerepo/file/LocalFile.php M includes/logging/LogEntry.php 2 files changed, 10 insertions(+), 62 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/62/262862/1 diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index b7d6f98..5a6a8b2 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1399,7 +1399,6 @@ # Update memcache after the commit $that->invalidateCache(); - $updateLogPage = false; if ( $newPageContent ) { # New file page; create the description page. # There's already a log entry, so don't make a second RC entry @@ -1421,7 +1420,12 @@ if ( isset( $status->value['revision'] ) ) { /** @var $rev Revision */ $rev = $status->value['revision']; - $updateLogPage = $rev->getPage(); + $that->getRepo()->getMasterDB()->update( + 'logging', + array( 'log_page' => $rev->getPage() ), + array( 'log_id' => $logId ), + __METHOD__ + ); } } else { # Existing file page: invalidate description page cache @@ -1431,32 +1435,7 @@ Article::purgePatrolFooterCache( $descId ); } - # Update associated rev id. This should be done by $logEntry->insert() earlier, - # but setAssociatedRevId() wasn't called at that point yet... - $logParams = $logEntry->getParameters(); - $logParams['associated_rev_id'] = $logEntry->getAssociatedRevId(); - $update = array( 'log_params' => LogEntryBase::makeParamBlob( $logParams ) ); - if ( $updateLogPage ) { - # Also log page, in case where we just created it above - $update['log_page'] = $updateLogPage; - } - $that->getRepo()->getMasterDB()->update( - 'logging', - $update, - array( 'log_id' => $logId ), - __METHOD__ - ); - $that->getRepo()->getMasterDB()->insert( - 'log_search', - array( - 'ls_field' => 'associated_rev_id', - 'ls_value' => $logEntry->getAssociatedRevId(), - 'ls_log_id' => $logId, - ), - __METHOD__ - ); - - # Now that the log entry is up-to-date, make an RC entry. + # Now that the page exists, make an RC entry. $logEntry->publish( $logId ); # Run hook for other updates (typically more cache purging) Hooks::run( 'FileUpload', array( $that, $reupload, !$newPageContent ) ); diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index db588fd..773af27 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -213,12 +213,6 @@ /** @var User */ protected $performer; - /** @var array Parameters for log entry */ - protected $params; - - /** @var int A rev id associated to the log entry */ - protected $revId = null; - /** @var bool Whether the parameters for this log entry are stored in new or old format. */ protected $legacy; @@ -245,7 +239,7 @@ } public function isLegacy() { - // This extracts the property + // This does the check $this->getParameters(); return $this->legacy; } @@ -271,20 +265,9 @@ $this->params = LogPage::extractParams( $blob ); $this->legacy = true; } - - if ( isset( $this->params['associated_rev_id'] ) ) { - $this->revId = $this->params['associated_rev_id']; - unset( $this->params['associated_rev_id'] ); - } } return $this->params; - } - - public function getAssociatedRevId() { - // This extracts the property - $this->getParameters(); - return $this->revId; } public function getPerformer() { @@ -336,10 +319,6 @@ protected function getRawParameters() { return $this->row->rc_params; - } - - public function getAssociatedRevId() { - return $this->row->rc_this_oldid; } public function getType() { @@ -572,16 +551,6 @@ // Truncate for whole multibyte characters. $comment = $wgContLang->truncate( $comment, 255 ); - $params = $this->getParameters(); - $relations = $this->relations; - - // Additional fields for which there's no space in the database table schema - $revId = $this->getAssociatedRevId(); - if ( $revId ) { - $params['associated_rev_id'] = $revId; - $relations['associated_rev_id'] = $revId; - } - $data = array( 'log_id' => $id, 'log_type' => $this->getType(), @@ -593,7 +562,7 @@ 'log_title' => $this->getTarget()->getDBkey(), 'log_page' => $this->getTarget()->getArticleID(), 'log_comment' => $comment, - 'log_params' => LogEntryBase::makeParamBlob( $params ), + 'log_params' => LogEntryBase::makeParamBlob( $this->getParameters() ), ); if ( isset( $this->deleted ) ) { $data['log_deleted'] = $this->deleted; @@ -603,7 +572,7 @@ $this->id = !is_null( $id ) ? $id : $dbw->insertId(); $rows = array(); - foreach ( $relations as $tag => $values ) { + foreach ( $this->relations as $tag => $values ) { if ( !strlen( $tag ) ) { throw new MWException( "Got empty log search tag." ); } -- To view, visit https://gerrit.wikimedia.org/r/262862 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I107036b9486d049638d4c93aab19aaafcf1d66b6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Cscott <canan...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits