Merge "MWTemplatePage: Account for template.title being null"

This commit is contained in:
jenkins-bot 2014-07-10 13:59:01 +00:00 committed by Gerrit Code Review
commit f3d183ddfa

View file

@ -62,7 +62,14 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
if ( this.spec.getDescription() ) {
this.$description.text( this.spec.getDescription() );
} else {
title = new mw.Title( this.template.getTitle() );
title = this.template.getTitle();
// The transcluded page may be dynamically generated or unspecified in the DOM
// for other reasons (bug 66724). In that case we can't tell the user what
// the template is called nor link to the template page.
if ( title ) {
title = mw.Title.newFromText( title );
}
if ( title ) {
if ( title.getNamespaceId() === 10 ) {
titleText = title.getMainText();
} else if ( title.getNamespaceId() === 0 ) {
@ -79,6 +86,8 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
mw.user
) );
}
}
this.infoFieldset.$element.append( this.$description );
this.$more
.addClass( 've-ui-mwTemplatePage-more' )