*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Revision\RevisionRecord;
use Wikimedia\Rdbms\IDatabase;
require_once __DIR__ . '/Maintenance.php';
}
$rt = null;
- $content = $page->getContent( Revision::RAW );
+ $content = $page->getContent( RevisionRecord::RAW );
if ( $content !== null ) {
$rt = $content->getUltimateRedirectTarget();
}
return;
}
- $content = $page->getContent( Revision::RAW );
- if ( $content === null ) {
- return;
- }
-
- $updates = $content->getSecondaryDataUpdates(
- $page->getTitle(), /* $old = */ null, /* $recursive = */ false );
- foreach ( $updates as $update ) {
- DeferredUpdates::addUpdate( $update );
- DeferredUpdates::doUpdates();
- }
+ // Defer updates to post-send but then immediately execute deferred updates;
+ // this is the simplest way to run all updates immediately (including updates
+ // scheduled by other updates).
+ $page->doSecondaryDataUpdates( [
+ 'defer' => DeferredUpdates::POSTSEND,
+ 'recursive' => false,
+ ] );
+ DeferredUpdates::doUpdates();
}
/**