From: Brad Jorsch Date: Tue, 18 Apr 2017 16:40:50 +0000 (-0400) Subject: Do an HTMLCacheUpdate of templatelinks on page creation X-Git-Tag: 1.31.0-rc.0~3476^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_modifier.php?a=commitdiff_plain;h=aaa1c2ab96a2c3e6715665f65c704e6c39a9e4a2;p=lhc%2Fweb%2Fwiklou.git Do an HTMLCacheUpdate of templatelinks on page creation When a page is created, anything that's trying to transclude that page needs to have an HTMLCacheUpdate run on it. But that's not currently happening. Normal template transclusion happens to get updates only because transclusion of a nonexistent template is rendered as a link to that template, which registers a pagelink, and pagelinks *are* being updated on page creation to cause redlinks to turn blue. Change-Id: I18b8cfdeedc53f8fdb1e758a6fca1cd23d9574f8 --- diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 82c32da5be..a687900431 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3252,6 +3252,9 @@ class WikiPage implements Page, IDBAccessObject { MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title ); + // Invalidate caches of articles which include this page + DeferredUpdates::addUpdate( new HTMLCacheUpdate( $title, 'templatelinks' ) ); + if ( $title->getNamespace() == NS_CATEGORY ) { // Load the Category object, which will schedule a job to create // the category table row if necessary. Checking a replica DB is ok