From: addshore Date: Fri, 4 Dec 2015 11:03:44 +0000 (+0100) Subject: Fix categories with a namespace prefix in the cat name for CatWatch X-Git-Tag: 1.31.0-rc.0~8822 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=10703fae49eb193225c805ab9bb0938e9336b5f5;p=lhc%2Fweb%2Fwiklou.git Fix categories with a namespace prefix in the cat name for CatWatch Title::newFromText will use the given namespace as default, but when parsing a title with a namespace at the begin the method will not use the default, instead used the namespace from the given text. Use Title::makeTitle to create a title with always belongs to the given namespace. Bug: T119763 Change-Id: Ic96671e1c33c6572b07f0f859d97c85a7a15bd39 --- diff --git a/includes/jobqueue/jobs/CategoryMembershipChangeJob.php b/includes/jobqueue/jobs/CategoryMembershipChangeJob.php index 2b0018d4a2..c9e20a9bea 100644 --- a/includes/jobqueue/jobs/CategoryMembershipChangeJob.php +++ b/includes/jobqueue/jobs/CategoryMembershipChangeJob.php @@ -165,7 +165,7 @@ class CategoryMembershipChangeJob extends Job { $insertCount = 0; foreach ( $categoryInserts as $categoryName ) { - $categoryTitle = Title::newFromText( $categoryName, NS_CATEGORY ); + $categoryTitle = Title::makeTitle( NS_CATEGORY, $categoryName ); $catMembChange->triggerCategoryAddedNotification( $categoryTitle ); if ( $insertCount++ && ( $insertCount % $batchSize ) == 0 ) { $dbw->commit( __METHOD__, 'flush' ); @@ -174,7 +174,7 @@ class CategoryMembershipChangeJob extends Job { } foreach ( $categoryDeletes as $categoryName ) { - $categoryTitle = Title::newFromText( $categoryName, NS_CATEGORY ); + $categoryTitle = Title::makeTitle( NS_CATEGORY, $categoryName ); $catMembChange->triggerCategoryRemovedNotification( $categoryTitle ); if ( $insertCount++ && ( $insertCount++ % $batchSize ) == 0 ) { $dbw->commit( __METHOD__, 'flush' );