Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71385


Change subject: Dependency inject DB into ManualLogEntry::insert()
......................................................................

Dependency inject DB into ManualLogEntry::insert()

Change-Id: I5018a6ef6095929edca444ad2d901adcf8680ed2
---
M includes/logging/LogEntry.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/71385/1

diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php
index b99f16b..92a0abe 100644
--- a/includes/logging/LogEntry.php
+++ b/includes/logging/LogEntry.php
@@ -430,12 +430,13 @@
 
        /**
         * Inserts the entry into the logging table.
+        * @param DatabaseBase $dbw
         * @return int If of the log entry
         */
-       public function insert() {
+       public function insert( DatabaseBase $dbw = null ) {
                global $wgContLang;
 
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $dbw ?: wfGetDB( DB_MASTER );
                $id = $dbw->nextSequenceValue( 'logging_log_id_seq' );
 
                if ( $this->timestamp === null ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/71385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5018a6ef6095929edca444ad2d901adcf8680ed2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to