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
$insertCount = 0;
foreach ( $categoryInserts as $categoryName ) {
$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' );
$catMembChange->triggerCategoryAddedNotification( $categoryTitle );
if ( $insertCount++ && ( $insertCount % $batchSize ) == 0 ) {
$dbw->commit( __METHOD__, 'flush' );
}
foreach ( $categoryDeletes as $categoryName ) {
}
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' );
$catMembChange->triggerCategoryRemovedNotification( $categoryTitle );
if ( $insertCount++ && ( $insertCount++ % $batchSize ) == 0 ) {
$dbw->commit( __METHOD__, 'flush' );