From dd6cb19f5d78e898d829565e7af3bc53692ad1af Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Wed, 3 Jul 2019 15:44:40 -0700 Subject: [PATCH] =?UTF-8?q?Backward=20compatibility=20check=20for=20?= =?UTF-8?q?=E2=80=98variableType=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/field_variable.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/field_variable.js b/core/field_variable.js index c097b0de2..a68a6882a 100644 --- a/core/field_variable.js +++ b/core/field_variable.js @@ -125,7 +125,10 @@ Blockly.FieldVariable.prototype.initModel = function() { Blockly.FieldVariable.prototype.fromXml = function(fieldElement) { var id = fieldElement.getAttribute('id'); var variableName = fieldElement.textContent; - var variableType = fieldElement.getAttribute('variabletype') || ''; + // 'variabletype' should be lowercase, but until July 2019 it was sometimes + // recorded as 'variableType'. Thus we need to check for both. + var variableType = fieldElement.getAttribute('variabletype') || + fieldElement.getAttribute('variableType') || ''; var variable = Blockly.Variables.getOrCreateVariablePackage( this.workspace_, id, variableName, variableType);