Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/49995
Change subject: Fixes handling of unsupported data types in snakview's value variation ...................................................................... Fixes handling of unsupported data types in snakview's value variation Removes old handling from snakview itself since it should never run into it anymore in that place. Change-Id: If94b42c2cf6bae71ac6ddb89a3398e00a61ef282 --- M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js 2 files changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/95/49995/1 diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js index c549941..0e2eb04 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js @@ -799,9 +799,7 @@ if( propertyId ) { // property ID selected but apparently no variation available to handle it this.$snakValue.append( $( '<span/>', { - text: this.snakType() - ? mw.msg( 'wikibase-snakview-unsupportedsnaktype', this._snakType ) - : mw.msg( 'wikibase-snakview-choosesnaktype' ), + 'text': mw.msg( 'wikibase-snakview-choosesnaktype' ), 'class': this.widgetBaseClass + '-unsupportedsnaktype' } ) ); // NOTE: instead of doing this here and checking everywhere whether this._variation diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js index 61bd1b4..73cb093 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js @@ -130,7 +130,7 @@ // display current Snak's data value in existing valueview: this._valueView.value( newValue ); } else { - // remove old view, create a new one: + // remove old view, create a new one or display message if unsupported data type this._createNewValueView( dataType, newValue ); } @@ -139,14 +139,16 @@ this.$viewPort.removeClass( this.variationBaseClass + '-datavaluetypemismatch' ); } - // switch to edit/non-edit view depending on snakview: - this._valueView[ ( this._viewState.isInEditMode() ? 'start' : 'stop' ) + 'Editing' ](); + if( this._valueView ) { + // switch to edit/non-edit view depending on snakview: + this._valueView[ ( this._viewState.isInEditMode() ? 'start' : 'stop' ) + 'Editing' ](); - // set state - if ( this._viewState.isDisabled() ) { - this._valueView.disable(); - } else { - this._valueView.enable(); + // set state + if ( this._viewState.isDisabled() ) { + this._valueView.disable(); + } else { + this._valueView.enable(); + } } }, -- To view, visit https://gerrit.wikimedia.org/r/49995 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If94b42c2cf6bae71ac6ddb89a3398e00a61ef282 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Werner <daniel.wer...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits