WANCacheReapUpdate: Handle special pages without exception
authorMatthew Flaschen <mflaschen@wikimedia.org>
Fri, 4 Aug 2017 22:39:38 +0000 (18:39 -0400)
committerMatthew Flaschen <mflaschen@wikimedia.org>
Fri, 4 Aug 2017 22:39:38 +0000 (18:39 -0400)
Bug: T172560
Change-Id: I95a6da2c5303e5fc4e931734e39974825d4c3c53

includes/deferred/WANCacheReapUpdate.php

index b12af19..cbeb1fc 100644 (file)
@@ -104,7 +104,13 @@ class WANCacheReapUpdate implements DeferrableUpdate {
                /** @var WikiPage[]|LocalFile[]|User[] $entities */
                $entities = [];
 
-               $entities[] = WikiPage::factory( Title::newFromTitleValue( $t ) );
+               // You can't create a WikiPage for special pages (-1) or other virtual
+               // namespaces, but special pages do appear in RC sometimes, e.g. for logs
+               // of AbuseFilter filter changes.
+               if ( $t->getNamespace() >= 0 ) {
+                       $entities[] = WikiPage::factory( Title::newFromTitleValue( $t ) );
+               }
+
                if ( $t->inNamespace( NS_FILE ) ) {
                        $entities[] = wfLocalFile( $t->getText() );
                }