$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
&& $lb->getServerCount() > 1
&& $lb->hasOrMadeRecentMasterChanges()
) {
- $dbw = $lb->getConnection( DB_MASTER );
+ $dbw = $lb->getConnectionRef( DB_MASTER );
$rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime );
}
if ( $rev ) {
MediaWikiServices::getInstance()->getDBLoadBalancerFactory()
);
+ $derivedDataUpdater->setLogger( LoggerFactory::getInstance( 'SaveParse' ) );
$derivedDataUpdater->setRcWatchCategoryMembership( $wgRCWatchCategoryMembership );
$derivedDataUpdater->setArticleCountMethod( $wgArticleCountMethod );
// 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 );
}
* - 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 = [] ) {
* (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().
*/
// 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 );
}