Do not generate negative page counts in dump
authorStanislav Malyshev <smalyshev@gmail.com>
Fri, 3 Aug 2018 01:01:11 +0000 (18:01 -0700)
committerStanislav Malyshev <smalyshev@gmail.com>
Fri, 3 Aug 2018 01:01:11 +0000 (18:01 -0700)
Due to T201119, some counts are not in sync. We are assuming
that in this case page count is just 0.

Change-Id: Iffd24270db6d852839d6922aa492c1975bf185e0

includes/CategoriesRdf.php

index fc296d4..eb601a2 100644 (file)
@@ -85,6 +85,10 @@ class CategoriesRdf {
         * @param int $subcategories Subcategory count
         */
        public function writeCategoryData( $categoryName, $isHidden, $pages, $subcategories ) {
+               if ( $pages < 0 ) {
+                       // Bugfix for T201119
+                       $pages = 0;
+               }
                $title = Title::makeTitle( NS_CATEGORY, $categoryName );
                $this->rdfWriter->about( $this->titleToUrl( $title ) )
                        ->say( 'a' )