lo0ol / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Misbehaviour of create "do procedure" #123

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Navigate to the code example
2. Drag a procedure to the workspace
3. Open the mutator and add a parameter (close the mutator if you like)
4. Right click on the block and select: create "do procedure"

What is the expected output? What do you see instead?
Expected is the visualization of a do procedure block with one parameter. 
Visible is just the do procedure without any parameter. If I click on the 
mutator button once again the do block changes its shape to the correct one. 

What browser are you using?
Mozilla Firefox Version 19.0.2 
Google Chrome Version 25.0.1364.160

OS: Ubuntu 12.04

Please provide any additional information below.
At the moment I don't know how to fix the problem properly, but one option 
might be to extend the callbackFactory function, so that is updates the do 
block like the original block does (use updateParams_() function of the 
procedures_def[no]return block). Since the callbackFactory is able to handle 
all kind of blocks it might be not as clean as required to add an if-else 
clause for all exceptions. It may have to be changed/extended or made more 
general to deal with additional requirements. 

But as I said I haven't invested so much time to think about a proper and clean 
solution. I also haven't thought about which block might produce similar 
problems or if the procedures are the only exception. E.g. how is a mutator 
enabled block (like the if block) created by the right click option if two else 
if and a else clause are required, how a list with 5 instead of 3 entries ...

best regards
Marc Wollenweber 

Original issue reported on code.google.com by borntob...@googlemail.com on 12 Mar 2013 at 9:42

GoogleCodeExporter commented 8 years ago
Good catch.  I've modified callbackFactory to take arbitrary XML as input.

The fix is out for review (presumably r688) and will be in the next push.

Original comment by neil.fra...@gmail.com on 13 Mar 2013 at 4:54