Merge "Revert "Hide HHVM tag on Special:{Contributions,RecentChanges,...}""
[lhc/web/wiklou.git] / includes / revisiondelete / RevDelList.php
index a0ff667..840fd77 100644 (file)
@@ -247,16 +247,22 @@ abstract class RevDelList extends RevisionListBase {
                } else {
                        $logType = 'delete';
                }
-               // Add params for effected page and ids
+               // Add params for affected page and ids
                $logParams = $this->getLogParams( $params );
                // Actually add the deletion log entry
-               $log = new LogPage( $logType );
-               $logid = $log->addEntry( $this->getLogAction(), $params['title'],
-                       $params['comment'], $logParams, $this->getUser() );
+               $logEntry = new ManualLogEntry( $logType, $this->getLogAction() );
+               $logEntry->setTarget( $params['title'] );
+               $logEntry->setComment( $params['comment'] );
+               $logEntry->setParameters( $logParams );
+               $logEntry->setPerformer( $this->getUser() );
                // Allow for easy searching of deletion log items for revision/log items
-               $log->addRelations( $field, $params['ids'], $logid );
-               $log->addRelations( 'target_author_id', $params['authorIds'], $logid );
-               $log->addRelations( 'target_author_ip', $params['authorIPs'], $logid );
+               $logEntry->setRelations( array(
+                       $field => $params['ids'],
+                       'target_author_id' => $params['authorIds'],
+                       'target_author_ip' => $params['authorIPs'],
+               ) );
+               $logId = $logEntry->insert();
+               $logEntry->publish( $logId );
        }
 
        /**
@@ -274,10 +280,10 @@ abstract class RevDelList extends RevisionListBase {
         */
        public function getLogParams( $params ) {
                return array(
-                       $this->getType(),
-                       implode( ',', $params['ids'] ),
-                       "ofield={$params['oldBits']}",
-                       "nfield={$params['newBits']}"
+                       '4::type' => $this->getType(),
+                       '5::ids' => $params['ids'],
+                       '6::ofield' => $params['oldBits'],
+                       '7::nfield' => $params['newBits'],
                );
        }