SB2 import: some imports seem broken
See original GitHub issueExpected Behavior
Demo: https://scratch.mit.edu/projects/150198954/ https://llk.github.io/scratch-gui/#150198954
In this project, the math operators looked like this in 2.0:
but look like this when imported into 3.0:
When executed, it appears that they are not running abs
, either, though (weird).
I believe the problem might be that https://github.com/LLK/scratch-vm/blob/develop/src/import/sb2specmap.js needs updating from https://github.com/LLK/scratch-blocks/pull/829/files; while some blocks were converted from having shadow-inputs to dropdown fields (undroppable), the spec map is still expecting shadow-inputs (e.g., look at operator_mathop
(previously a shadow-input) vs. whenKeyPressed
(field)). Not a great failure mode, possibly this case could be detected and cause a throw or something. 😃
Actual Behavior
Selections should match 2.0.
Steps to Reproduce
Create a project in 2.0 using the math op block and select a math operation. It won’t be selected correctly in 3.0
Operating System and Browser
Mac OS 10.12.1 Chrome latest
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks @tmickel . Good catch. We’ll take a look next week after we get through testing on Thursday (our testing this round doesn’t include imports from 2.0).
Not sure about custom blocks - those are pretty untouched as far as 3.0 development.
Another thing I noticed though: variables are sometimes broken on the import. That’s because they were previously using an input, like this:
But, scratch-blocks was updated to have variables on a particular field: https://github.com/LLK/scratch-blocks/blob/develop/blocks_vertical/data.js#L66
The mismatch causes weird things, like this variable called
count
in Scratch 2.0 which appears in the blocks editor asi
.