Santhosh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/323789
Change subject: Check for null value of template params to avoid js error
......................................................................
Check for null value of template params to avoid js error
Bug: T151621
Change-Id: Ibe9c6c499a2a0848f31ce66f16c734a6bd35be5a
---
M modules/tools/ext.cx.tools.template.editor.js
1 file changed, 3 insertions(+), 3 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/89/323789/1
diff --git a/modules/tools/ext.cx.tools.template.editor.js
b/modules/tools/ext.cx.tools.template.editor.js
index 01bcb98..c7a0b3e 100644
--- a/modules/tools/ext.cx.tools.template.editor.js
+++ b/modules/tools/ext.cx.tools.template.editor.js
@@ -352,8 +352,8 @@
option = new mw.cx.widgets.TemplateParamOptionWidget( {
data: key,
classes: [
'cx-template-editor-param-selector-item' ],
- label: value.label && value.label[ language ]
|| key,
- description: value.description &&
value.description[ language ]
+ label: value && value.label && value.label[
language ] || key,
+ description: value && value.description &&
value.description[ language ] || ''
} );
option.$element.append( $desc );
items.push( option );
@@ -449,7 +449,7 @@
} );
$.each( this.targetTemplate.params, function ( key, value ) {
- if ( value.changed ) {
+ if ( value && value.changed ) {
if ( !value.html || !isNaN( value.html ) ) {
// Value cleared/deleted/a number. Save
an API call.
value.wt = value.html;
--
To view, visit https://gerrit.wikimedia.org/r/323789
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe9c6c499a2a0848f31ce66f16c734a6bd35be5a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits