diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/revisiondelete/RevDelLogItem.php | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
Diffstat (limited to 'includes/revisiondelete/RevDelLogItem.php')
-rw-r--r-- | includes/revisiondelete/RevDelLogItem.php | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/includes/revisiondelete/RevDelLogItem.php b/includes/revisiondelete/RevDelLogItem.php index 49adf204..65b03097 100644 --- a/includes/revisiondelete/RevDelLogItem.php +++ b/includes/revisiondelete/RevDelLogItem.php @@ -48,11 +48,26 @@ class RevDelLogItem extends RevDelItem { } public function getBits() { - return $this->row->log_deleted; + return (int)$this->row->log_deleted; } public function setBits( $bits ) { $dbw = wfGetDB( DB_MASTER ); + + $dbw->update( 'logging', + array( 'log_deleted' => $bits ), + array( + 'log_id' => $this->row->log_id, + 'log_deleted' => $this->getBits() // cas + ), + __METHOD__ + ); + + if ( !$dbw->affectedRows() ) { + // Concurrent fail! + return false; + } + $dbw->update( 'recentchanges', array( 'rc_deleted' => $bits, @@ -64,16 +79,8 @@ class RevDelLogItem extends RevDelItem { ), __METHOD__ ); - $dbw->update( 'logging', - array( 'log_deleted' => $bits ), - array( - 'log_id' => $this->row->log_id, - 'log_deleted' => $this->getBits() - ), - __METHOD__ - ); - return (bool)$dbw->affectedRows(); + return true; } public function getHTML() { |