Make the private-logs-UDP code path in saveContent() also return $newId
authorCatrope <roan.kattouw@gmail.com>
Sun, 13 May 2012 21:40:15 +0000 (14:40 -0700)
committerCatrope <roan.kattouw@gmail.com>
Sun, 13 May 2012 21:47:19 +0000 (14:47 -0700)
This was an oversight in a69fb4827409786203ee6f4befc5aa4009d13ef8 which
changed saveContent() (and, by extension, addEntry()) to return a log_id
rather than a boolean.

Also update the documentation comments to reflect this, and remove a
resolved TODO

Change-Id: I8fe269f452f8c8d4fa0318c120b676ac10efebae

includes/logging/LogPage.php

index 88f3484..3891f34 100644 (file)
@@ -68,7 +68,7 @@ class LogPage {
        }
 
        /**
-        * @return bool|int|null
+        * @return int log_id of the inserted log entry
         */
        protected function saveContent() {
                global $wgLogRestrictions;
@@ -105,7 +105,7 @@ class LogPage {
                } elseif( $this->sendToUDP ) {
                        # Don't send private logs to UDP
                        if( isset( $wgLogRestrictions[$this->type] ) && $wgLogRestrictions[$this->type] != '*' ) {
-                               return true;
+                               return $newId;
                        }
 
                        # Notify external application via UDP.
@@ -438,8 +438,7 @@ class LogPage {
         * @param $params Array: parameters passed later to wfMsg.* functions
         * @param $doer User object: the user doing the action
         *
-        * @return bool|int|null
-        * @TODO: make this use LogEntry::saveContent()
+        * @return int log_id of the inserted log entry
         */
        public function addEntry( $action, $target, $comment, $params = array(), $doer = null ) {
                global $wgContLang;