Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / Title.php
index 5e1e8c6..3c51bae 100644 (file)
@@ -1412,7 +1412,6 @@ class Title implements LinkTarget {
                        $fragment,
                        $this->getInterwiki()
                );
-
        }
 
        /**
@@ -2926,7 +2925,6 @@ class Title implements LinkTarget {
 
                        # Cycle through all the restrictions.
                        foreach ( $rows as $row ) {
-
                                // Don't take care of restrictions types that aren't allowed
                                if ( !in_array( $row->pr_type, $restrictionTypes ) ) {
                                        continue;
@@ -4391,16 +4389,19 @@ class Title implements LinkTarget {
        public function invalidateCache( $purgeTime = null ) {
                if ( wfReadOnly() ) {
                        return false;
-               }
-
-               if ( $this->mArticleID === 0 ) {
+               } elseif ( $this->mArticleID === 0 ) {
                        return true; // avoid gap locking if we know it's not there
                }
 
+               $dbw = wfGetDB( DB_MASTER );
+               $dbw->onTransactionPreCommitOrIdle( function () {
+                       ResourceLoaderWikiModule::invalidateModuleCache( $this, null, null, wfWikiID() );
+               } );
+
                $conds = $this->pageCond();
                DeferredUpdates::addUpdate(
                        new AutoCommitUpdate(
-                               wfGetDB( DB_MASTER ),
+                               $dbw,
                                __METHOD__,
                                function ( IDatabase $dbw, $fname ) use ( $conds, $purgeTime ) {
                                        $dbTimestamp = $dbw->timestamp( $purgeTime ?: time() );
@@ -4597,7 +4598,6 @@ class Title implements LinkTarget {
                        : $wgExemptFromUserRobotsControl;
 
                return !in_array( $this->mNamespace, $bannedNamespaces );
-
        }
 
        /**