When normalizing category titles with mw.Title, use getMain method

This will get the name attribute plus this extension

Bug: 50702
Change-Id: I57298ef34b413002f1506b499903b73a18969e68
This commit is contained in:
Rob Moen 2013-07-10 15:47:37 -07:00
parent ac6c10dad7
commit 6fba04f121

View file

@ -79,7 +79,7 @@ ve.ui.MWCategoryInputWidget.prototype.getLookupCacheItemFromData = function ( da
for ( i = 0, len = data[1].length; i < len; i++ ) { for ( i = 0, len = data[1].length; i < len; i++ ) {
try { try {
title = new mw.Title( data[1][i] ); title = new mw.Title( data[1][i] );
result.push( title.getNameText() ); result.push( title.getMainText() );
} catch ( e ) { } } catch ( e ) { }
// If the received title isn't valid, just ignore it // If the received title isn't valid, just ignore it
} }
@ -181,7 +181,7 @@ ve.ui.MWCategoryInputWidget.prototype.getCategoryItemFromValue = function ( valu
title = new mw.Title( this.categoryPrefix + value ); title = new mw.Title( this.categoryPrefix + value );
return { return {
'name': title.getPrefixedText(), 'name': title.getPrefixedText(),
'value': title.getNameText(), 'value': title.getMainText(),
'metaItem': {} 'metaItem': {}
}; };
} catch ( e ) { } } catch ( e ) { }