X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FRevision.php;h=885544131066513061abdd6b647e1fdd6e51fc47;hp=006e70064537d4803a7f9cac1b2a4377ea09465a;hb=288fb8cafaa14e5bacda9316536f36fe4425b8a4;hpb=670c94ebf528155b9a9017784591e23ef57b9884 diff --git a/includes/Revision.php b/includes/Revision.php index 006e700645..8855441310 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -362,7 +362,7 @@ class Revision implements IDBAccessObject { $row = self::fetchFromConds( $db, $conditions, $flags ); if ( $row ) { $rev = new Revision( $row ); - $rev->mWiki = $db->getWikiID(); + $rev->mWiki = $db->getDomainID(); return $rev; } @@ -645,6 +645,10 @@ class Revision implements IDBAccessObject { # if we have a content object, use it to set the model and type if ( !empty( $row['content'] ) ) { + if ( !( $row['content'] instanceof Content ) ) { + throw new MWException( '`content` field must contain a Content object.' ); + } + // @todo when is that set? test with external store setup! check out insertOn() [dk] if ( !empty( $row['text_id'] ) ) { throw new MWException( "Text already stored in external store (id {$row['text_id']}), " . @@ -685,10 +689,6 @@ class Revision implements IDBAccessObject { // if we have a Content object, override mText and mContentModel if ( !empty( $row['content'] ) ) { - if ( !( $row['content'] instanceof Content ) ) { - throw new MWException( '`content` field must contain a Content object.' ); - } - $handler = $this->getContentHandler(); $this->mContent = $row['content']; @@ -1941,7 +1941,7 @@ class Revision implements IDBAccessObject { $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); return $cache->getWithSetCallback( // Page/rev IDs passed in from DB to reflect history merges - $cache->makeGlobalKey( 'revision', $db->getWikiID(), $pageId, $revId ), + $cache->makeGlobalKey( 'revision', $db->getDomainID(), $pageId, $revId ), $cache::TTL_WEEK, function ( $curValue, &$ttl, array &$setOpts ) use ( $db, $pageId, $revId ) { $setOpts += Database::getCacheSetOptions( $db );