Merge "Use our fork of less.php" into REL1_31
[lhc/web/wiklou.git] / includes / logging / LogEntry.php
index 395110b..e17ac03 100644 (file)
@@ -213,6 +213,30 @@ class DatabaseLogEntry extends LogEntryBase {
                }
        }
 
+       /**
+        * Loads a LogEntry with the given id from database
+        *
+        * @param int $id
+        * @param IDatabase $db
+        * @return DatabaseLogEntry|null
+        */
+       public static function newFromId( $id, IDatabase $db ) {
+               $queryInfo = self::getSelectQueryData();
+               $queryInfo['conds'] += [ 'log_id' => $id ];
+               $row = $db->selectRow(
+                       $queryInfo['tables'],
+                       $queryInfo['fields'],
+                       $queryInfo['conds'],
+                       __METHOD__,
+                       $queryInfo['options'],
+                       $queryInfo['join_conds']
+               );
+               if ( !$row ) {
+                       return null;
+               }
+               return self::newFromRow( $row );
+       }
+
        /** @var stdClass Database result row. */
        protected $row;
 
@@ -758,13 +782,6 @@ class ManualLogEntry extends LogEntryBase {
                                        if ( $to === 'udp' || $to === 'rcandudp' ) {
                                                $rc->notifyRCFeeds();
                                        }
-
-                                       // Log the autopatrol if the log entry is patrollable
-                                       if ( $this->getIsPatrollable() &&
-                                               $rc->getAttribute( 'rc_patrolled' ) === 1
-                                       ) {
-                                               PatrolLog::record( $rc, true, $this->getPerformer() );
-                                       }
                                }
                        },
                        DeferredUpdates::POSTSEND,