* @return bool
*/
public function isRedirect() {
- $content = $this->getContent();
- if ( !$content ) {
- return false;
+ if ( !$this->mDataLoaded ) {
+ $this->loadPageData();
}
- return $content->isRedirect();
+ return (bool)$this->mIsRedirect;
}
/**
if ( $rt->isExternal() ) {
if ( $rt->isLocal() ) {
// Offsite wikis need an HTTP redirect.
- //
// This can be hard to reverse and may produce loops,
// so they may be disabled in the site configuration.
$source = $this->mTitle->getFullURL( 'redirect=no' );
if ( $rt->isSpecialPage() ) {
// Gotta handle redirects to special pages differently:
- // Fill the HTTP response "Location" header and ignore
- // the rest of the page we're on.
- //
- // Some pages are not valid targets
+ // Fill the HTTP response "Location" header and ignore the rest of the page we're on.
+ // Some pages are not valid targets.
if ( $rt->isValidRedirectTarget() ) {
return $rt->getFullURL();
} else {
) {
ContentHandler::deprecated( __METHOD__, '1.21' );
- //NOTE: keep condition in sync with condition in replaceSectionContent!
+ // NOTE: keep condition in sync with condition in replaceSectionContent!
if ( strval( $sectionId ) === '' ) {
// Whole-page edit; let the whole text through
return $text;
}
$revisionId = $revision->insertOn( $dbw );
- // Update page
- //
+ // Update page.
// We check for conflicts by comparing $oldid with the current latest revision ID.
$ok = $this->updateRevisionOn( $dbw, $revision, $oldid, $oldIsRedirect );
}
$user = is_null( $user ) ? $wgUser : $user;
- //XXX: check $user->getId() here???
+ // XXX: check $user->getId() here???
// Use a sane default for $serialFormat, see bug 57026
if ( $serialFormat === null ) {
$bitfield = 'rev_deleted';
}
- // For now, shunt the revision data into the archive table.
- // Text is *not* removed from the text table; bulk storage
- // is left intact to avoid breaking block-compression or
- // immutable storage schemes.
- //
- // For backwards compatibility, note that some older archive
- // table entries will have ar_text and ar_flags fields still.
- //
- // In the future, we may keep revisions and mark them with
- // the rev_deleted field, which is reserved for this purpose.
+ /**
+ * For now, shunt the revision data into the archive table.
+ * Text is *not* removed from the text table; bulk storage
+ * is left intact to avoid breaking block-compression or
+ * immutable storage schemes.
+ *
+ * For backwards compatibility, note that some older archive
+ * table entries will have ar_text and ar_flags fields still.
+ *
+ * In the future, we may keep revisions and mark them with
+ * the rev_deleted field, which is reserved for this purpose.
+ */
$row = array(
'ar_namespace' => 'page_namespace',
* may already return null when the page proper was deleted.
*/
public function doDeleteUpdates( $id, Content $content = null ) {
- // update site status
+ // Update site status
DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, - (int)$this->isCountable(), -1 ) );
- // remove secondary indexes, etc
+ // Delete pagelinks, update secondary indexes, etc
$updates = $this->getDeletionUpdates( $content );
- DataUpdate::runUpdates( $updates, 'enqueue' );
+ // Make sure an enqueued jobs run after commit so they see the deletion
+ wfGetDB( DB_MASTER )->onTransactionIdle( function() use ( $updates ) {
+ DataUpdate::runUpdates( $updates, 'enqueue' );
+ } );
// Reparse any pages transcluding this page
LinksUpdate::queueRecursiveJobsForTable( $this->mTitle, 'templatelinks' );