X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=332b1ee482899882d55cf964f13386e61442127e;hb=97675af31ac1f8599e43530c23b71da26f1ba5ec;hp=8f39650cbd1809e7b1a350f228ecb7449f4fdd9a;hpb=1d1bb122942d2ca6e557dc13e2d198276ce65ba6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 8f39650cbd..332b1ee482 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1342,7 +1342,7 @@ class WikiPage implements Page, IDBAccessObject { 'page_len' => 0, // Fill this in shortly... ] + $pageIdForInsert, __METHOD__, - 'IGNORE' + [ 'IGNORE' ] ); if ( $dbw->affectedRows() > 0 ) { @@ -1962,9 +1962,7 @@ class WikiPage implements Page, IDBAccessObject { * @deprecated since 1.32, use getDerivedDataUpdater instead. * * @param Content $content - * @param Revision|RevisionRecord|int|null $revision Revision object. - * For backwards compatibility, a revision ID is also accepted, - * but this is deprecated. + * @param Revision|RevisionRecord|null $revision Revision object. * Used with vary-revision or vary-revision-id. * @param User|null $user * @param string|null $serialFormat IGNORED @@ -1987,19 +1985,13 @@ class WikiPage implements Page, IDBAccessObject { $user = $wgUser; } - if ( !is_object( $revision ) ) { - $revid = $revision; - // This code path is deprecated, and nothing is known to - // use it, so performance here shouldn't be a worry. - if ( $revid !== null ) { - wfDeprecated( __METHOD__ . ' with $revision = revision ID', '1.25' ); - $store = $this->getRevisionStore(); - $revision = $store->getRevisionById( $revid, Revision::READ_LATEST ); - } else { - $revision = null; + if ( $revision !== null ) { + if ( $revision instanceof Revision ) { + $revision = $revision->getRevisionRecord(); + } elseif ( !( $revision instanceof RevisionRecord ) ) { + throw new InvalidArgumentException( + __METHOD__ . ': invalid $revision argument type ' . gettype( $revision ) ); } - } elseif ( $revision instanceof Revision ) { - $revision = $revision->getRevisionRecord(); } $slots = RevisionSlotsUpdate::newFromContent( [ SlotRecord::MAIN => $content ] ); @@ -2114,8 +2106,6 @@ class WikiPage implements Page, IDBAccessObject { * - defer: one of the DeferredUpdates constants, or false to run immediately (default: false). * Note that even when this is set to false, some updates might still get deferred (as * some update might directly add child updates to DeferredUpdates). - * - transactionTicket: a transaction ticket from LBFactory::getEmptyTransactionTicket(), - * only when defer is false (default: null) * @since 1.32 */ public function doSecondaryDataUpdates( array $options = [] ) {