X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMovePage.php;h=bcec0a188d02bf0c1b1d1a0e5f8b84d482cafa0a;hb=e2b03d5d30a8a6c62569a336622b865f47e148d0;hp=ffe4faba404cb418d942f8ae0a8e947a3bf9a92d;hpb=ea1781053eb3842dc149aa7065edb8c028ff88de;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MovePage.php b/includes/MovePage.php index ffe4faba40..bcec0a188d 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -21,6 +21,7 @@ use MediaWiki\MediaWikiServices; use MediaWiki\Revision\SlotRecord; +use Wikimedia\Rdbms\IDatabase; /** * Handles the backend logic of moving a page from one title @@ -250,7 +251,7 @@ class MovePage { } $dbw = wfGetDB( DB_MASTER ); - $dbw->startAtomic( __METHOD__ ); + $dbw->startAtomic( __METHOD__, IDatabase::ATOMIC_CANCELABLE ); Hooks::run( 'TitleMoveStarting', [ $this->oldTitle, $this->newTitle, $user ] ); @@ -425,7 +426,7 @@ class MovePage { * Move a file associated with a page to a new location. * Can also be used to revert after a DB failure. * - * @access private + * @private * @param Title Old location to move the file from. * @param Title New location to move the file to. * @return Status @@ -433,7 +434,7 @@ class MovePage { private function moveFile( $oldTitle, $newTitle ) { $status = Status::newFatal( 'cannotdelete', - $oldTitle->getPrefixedText()->escaped() + $oldTitle->getPrefixedText() ); $file = wfLocalFile( $oldTitle ); @@ -493,7 +494,8 @@ class MovePage { ); if ( !$status->isGood() ) { - throw new MWException( 'Failed to delete page-move revision: ' . $status ); + throw new MWException( 'Failed to delete page-move revision: ' + . $status->getWikiText( false, false, 'en' ) ); } $nt->resetArticleID( false );