When someone uploads a new file, we should refresh all the pages
that use that image, so that [[Category:Pages with broken file links]]
gets removed.
Future fixme would to run this again on file deletes, but that's
less critical as they will eventually get added on next reparse
and people don't expect that to happen instantly like when fixing
the issue. Ditto for someone creating a new file redirect.
Bug: 46749
Change-Id: I7889598eee54a1c07c64f750b8499e922ba59704
is disabled, and AJAX patrolling and watching are now disabled when use of
the write API is not allowed.
* (bug 48294) API: Fix chunk upload async mode.
is disabled, and AJAX patrolling and watching are now disabled when use of
the write API is not allowed.
* (bug 48294) API: Fix chunk upload async mode.
+* (bug 46749) Broken files tracking category removed from pages if an image
+ with that name is uploaded.
=== API changes in 1.22 ===
* (bug 46626) xmldoublequote parameter was removed. Because of a bug, the
=== API changes in 1.22 ===
* (bug 46626) xmldoublequote parameter was removed. Because of a bug, the
wfProfileOut( __METHOD__ );
}
wfProfileOut( __METHOD__ );
}
+ /**
+ * Queue recursive jobs for this page
+ *
+ * Which means do LinksUpdate on all templates
+ * that include the current page, using the job queue.
+ */
function queueRecursiveJobs() {
function queueRecursiveJobs() {
- wfProfileIn( __METHOD__ );
+ self::queueRecursiveJobsForTable( $this->mTitle, 'templatelinks' );
+ }
- if ( $this->mTitle->getBacklinkCache()->hasLinks( 'templatelinks' ) ) {
+ /**
+ * Queue a RefreshLinks job for any table.
+ *
+ * @param Title $title Title to do job for
+ * @param String $table Table to use (e.g. 'templatelinks')
+ */
+ public static function queueRecursiveJobsForTable( Title $title, $table ) {
+ wfProfileIn( __METHOD__ );
+ if ( $title->getBacklinkCache()->hasLinks( $table ) ) {
$job = new RefreshLinksJob2(
$job = new RefreshLinksJob2(
- 'table' => 'templatelinks',
) + Job::newRootJobParams( // "overall" refresh links job info
) + Job::newRootJobParams( // "overall" refresh links job info
- "refreshlinks:templatelinks:{$this->mTitle->getPrefixedText()}"
+ "refreshlinks:{$table}:{$title->getPrefixedText()}"
)
);
JobQueueGroup::singleton()->push( $job );
JobQueueGroup::singleton()->deduplicateRootJob( $job );
}
)
);
JobQueueGroup::singleton()->push( $job );
JobQueueGroup::singleton()->deduplicateRootJob( $job );
}
wfProfileOut( __METHOD__ );
}
wfProfileOut( __METHOD__ );
}
# Invalidate cache for all pages using this file
$update = new HTMLCacheUpdate( $this->getTitle(), 'imagelinks' );
$update->doUpdate();
# Invalidate cache for all pages using this file
$update = new HTMLCacheUpdate( $this->getTitle(), 'imagelinks' );
$update->doUpdate();
+ if ( !$reupload ) {
+ LinksUpdate::queueRecursiveJobsForTable( $this->getTitle(), 'imagelinks' );
+ }
# Invalidate cache for all pages that redirects on this page
$redirs = $this->getTitle()->getRedirectsHere();
foreach ( $redirs as $redir ) {
# Invalidate cache for all pages that redirects on this page
$redirs = $this->getTitle()->getRedirectsHere();
foreach ( $redirs as $redir ) {
+ if ( !$reupload && $redir->getNamespace() === NS_FILE ) {
+ LinksUpdate::queueRecursiveJobsForTable( $redir, 'imagelinks' );
+ }
$update = new HTMLCacheUpdate( $redir, 'imagelinks' );
$update->doUpdate();
}
$update = new HTMLCacheUpdate( $redir, 'imagelinks' );
$update->doUpdate();
}