X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMovePage.php;h=2cd9698c0f5a654a237ce4289fa5205c8ef0fc72;hb=be09a508877fb1a2441e8c7783742a84111b6851;hp=964fbffff65aeaadb4d407b3f083fd9ce5431e3f;hpb=d2278d1c2ae98e2c177acdab400614f29ac54591;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MovePage.php b/includes/MovePage.php index 964fbffff6..2cd9698c0f 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -305,8 +305,8 @@ class MovePage { __METHOD__, array( 'IGNORE' ) ); - # Update the protection log - $log = new LogPage( 'protect' ); + + // Build comment for log $comment = wfMessage( 'prot_1movedto2', $this->oldTitle->getPrefixedText(), @@ -315,14 +315,6 @@ class MovePage { if ( $reason ) { $comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason; } - // @todo FIXME: $params? - $logId = $log->addEntry( - 'move_prot', - $this->newTitle, - $comment, - array( $this->oldTitle->getPrefixedText() ), - $user - ); // reread inserted pr_ids for log relation $insertedPrIds = $dbw->select( @@ -335,7 +327,18 @@ class MovePage { foreach ( $insertedPrIds as $prid ) { $logRelationsValues[] = $prid->pr_id; } - $log->addRelations( 'pr_id', $logRelationsValues, $logId ); + + // Update the protection log + $logEntry = new ManualLogEntry( 'protect', 'move_prot' ); + $logEntry->setTarget( $this->newTitle ); + $logEntry->setComment( $comment ); + $logEntry->setPerformer( $user ); + $logEntry->setParameters( array( + '4::oldtitle' => $this->oldTitle->getPrefixedText(), + ) ); + $logEntry->setRelations( array( 'pr_id' => $logRelationsValues ) ); + $logId = $logEntry->insert(); + $logEntry->publish( $logId ); } // Update *_from_namespace fields as needed