X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=f0164944325caadaa70cebf329768aadfe28042d;hp=a5ac78f10dc64f89dc484500b18bf6e6f7bc6fca;hb=3a4105ba01fc92f2d41e0faee316d02e29f82fe5;hpb=93c3eae1ff89c54bd08c5b295fe4ac66a982ea30 diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index a5ac78f10d..f016494432 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -938,8 +938,8 @@ class WikiPage implements Page, IDBAccessObject { $dbw->startAtomic( __METHOD__ ); if ( !$oldLatest || $oldLatest == $this->lockAndGetLatest() ) { - $dbw->replace( 'redirect', - [ 'rd_from' ], + $dbw->upsert( + 'redirect', [ 'rd_from' => $this->getId(), 'rd_namespace' => $rt->getNamespace(), @@ -947,6 +947,13 @@ class WikiPage implements Page, IDBAccessObject { 'rd_fragment' => $rt->getFragment(), 'rd_interwiki' => $rt->getInterwiki(), ], + [ 'rd_from' ], + [ + 'rd_namespace' => $rt->getNamespace(), + 'rd_title' => $rt->getDBkey(), + 'rd_fragment' => $rt->getFragment(), + 'rd_interwiki' => $rt->getInterwiki(), + ], __METHOD__ ); } @@ -2861,7 +2868,7 @@ class WikiPage implements Page, IDBAccessObject { */ public function doDeleteArticleReal( $reason, $suppress = false, $u1 = null, $u2 = null, &$error = '', User $user = null, - $tags = [] + $tags = [], $logsubtype = 'delete' ) { global $wgUser, $wgContentHandlerUseDB; @@ -2992,7 +2999,7 @@ class WikiPage implements Page, IDBAccessObject { // Log the deletion, if the page was suppressed, put it in the suppression log instead $logtype = $suppress ? 'suppress' : 'delete'; - $logEntry = new ManualLogEntry( $logtype, 'delete' ); + $logEntry = new ManualLogEntry( $logtype, $logsubtype ); $logEntry->setPerformer( $user ); $logEntry->setTarget( $logTitle ); $logEntry->setComment( $reason );