X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=6f94ccf0187f7c79eddc7861cf86e98325e766ea;hb=f72ae0f6e6ae71e12dd18e5c2d6e1712e5becfbd;hp=332b1ee482899882d55cf964f13386e61442127e;hpb=37e011b5554dd9b2966ccfdbef9a9bc8309a233f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 332b1ee482..6f94ccf018 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1588,7 +1588,7 @@ class WikiPage implements Page, IDBAccessObject { $baseRevId = null; if ( $edittime && $sectionId !== 'new' ) { $lb = $this->getDBLoadBalancer(); - $dbr = $lb->getConnection( DB_REPLICA ); + $dbr = $lb->getConnectionRef( DB_REPLICA ); $rev = Revision::loadFromTimestamp( $dbr, $this->mTitle, $edittime ); // Try the master if this thread may have just added it. // This could be abstracted into a Revision method, but we don't want @@ -1597,7 +1597,7 @@ class WikiPage implements Page, IDBAccessObject { && $lb->getServerCount() > 1 && $lb->hasOrMadeRecentMasterChanges() ) { - $dbw = $lb->getConnection( DB_MASTER ); + $dbw = $lb->getConnectionRef( DB_MASTER ); $rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime ); } if ( $rev ) { @@ -1697,6 +1697,7 @@ class WikiPage implements Page, IDBAccessObject { MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ); + $derivedDataUpdater->setLogger( LoggerFactory::getInstance( 'SaveParse' ) ); $derivedDataUpdater->setRcWatchCategoryMembership( $wgRCWatchCategoryMembership ); $derivedDataUpdater->setArticleCountMethod( $wgArticleCountMethod ); @@ -1904,7 +1905,11 @@ class WikiPage implements Page, IDBAccessObject { // TODO: this logic should not be in the storage layer, it's here for compatibility // with 1.31 behavior. Applying the 'autopatrol' right should be done in the same // place the 'bot' right is handled, which is currently in EditPage::attemptSave. - if ( $needsPatrol && $this->getTitle()->userCan( 'autopatrol', $user ) ) { + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + + if ( $needsPatrol && $permissionManager->userCan( + 'autopatrol', $user, $this->getTitle() + ) ) { $updater->setRcPatrolStatus( RecentChange::PRC_AUTOPATROLLED ); } @@ -2106,6 +2111,11 @@ 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). + * - known-revision-output: a combined canonical ParserOutput for the revision, perhaps + * from some cache. The caller is responsible for ensuring that the ParserOutput indeed + * matched the $rev and $options. This mechanism is intended as a temporary stop-gap, + * for the time until caches have been changed to store RenderedRevision states instead + * of ParserOutput objects. (default: null) (since 1.33) * @since 1.32 */ public function doSecondaryDataUpdates( array $options = [] ) { @@ -3073,7 +3083,7 @@ class WikiPage implements Page, IDBAccessObject { * (with ChangeTags::canAddTagsAccompanyingChange) * * @return array Array of errors, each error formatted as - * array(messagekey, param1, param2, ...). + * [ messagekey, param1, param2, ... ]. * On success, the array is empty. This array can also be passed to * OutputPage::showPermissionsErrorPage(). */ @@ -3267,7 +3277,11 @@ class WikiPage implements Page, IDBAccessObject { // TODO: this logic should not be in the storage layer, it's here for compatibility // with 1.31 behavior. Applying the 'autopatrol' right should be done in the same // place the 'bot' right is handled, which is currently in EditPage::attemptSave. - if ( $wgUseRCPatrol && $this->getTitle()->userCan( 'autopatrol', $guser ) ) { + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + + if ( $wgUseRCPatrol && $permissionManager->userCan( + 'autopatrol', $guser, $this->getTitle() + ) ) { $updater->setRcPatrolStatus( RecentChange::PRC_AUTOPATROLLED ); }