Page 1 of 1

fragile processes

Posted: 09 March 2013, 03:42
by ddyer
I made this simple change in go_go.tpl



and got this incomprehensible error as a pop-up, which disappeared after a short delay,
and doesn't apparently appear in any more persistent place.
from
<div id="stoneicon_p${id}" class="go_stoneicon go_stoneicon{color}"></div><span id="stonecount_p${id}">0</span>\
to
<div id="stoneicon_p${id}" class="go_stone_${board_size} go_stoneicon_{color}"></div><span id="stonecount_p${id}">0</span>\

leaving aside what mistaken thing I was trying to do; It's not very satisfactory for a simple edit like
this to result in such a catastrophic and opaque error.

---

Javascript error:
During pageload
Cannot call method 'toString' of undefined
TypeError: Cannot call method 'toString' of undefined
at http://en.1.studio.boardgamearena.com/t ... :15:273363
at String.replace (native)
at Object._6f1.substitute (http://en.1.studio.boardgamearena.com/t ... :15:273162)
at _62b.format_block (http://en.1.studio.boardgamearena.com/t ... :15:250995)
at declare.setup (http://en.1.studio.boardgamearena.com/t ... 1031:66:34)
at _54d.completesetup (http://en.1.studio.boardgamearena.com/t ... :15:175793)
at http://en.1.studio.boardgamearena.com/g ... 333:578:24
at _c6 (http://en.1.studio.boardgamearena.com/t ... s:15:11357)
at _36 (http://en.1.studio.boardgamearena.com/t ... s:15:12968)
at http://en.1.studio.boardgamearena.com/t ... s:15:13214
Script:
Url: http://en.1.studio.boardgamearena.com/g ... er=2243333
U=2243333
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22
The requested page was not found

Re: fragile processes

Posted: 10 March 2013, 21:50
by sourisdudesert
Hello,

Indeed, this happens when there is a mismatch between your arguments and your template string.

Error is from the Dojo framework, I doubt we can do something about this...

I'll add a paragraph about this error on the "practical debugging" help section.

Cheers,

Re: fragile processes

Posted: 11 March 2013, 06:54
by ddyer
It appears that there are two levels of substitution going on, one in the "view" substitutions, but the
template contains other items that look like substitutions (such as {id} and {color}) that will be performed
by format_block in the javascript code. I haven't encountered where this is mentioned.

The overall behavior led me to guess that format_block is doing some simple positional subsctitution,
such that the unresolved {GO_GAME} substitution disrupted it.

It would be very useful in cases like this if you could at least site the source line that caused the
blowout. When more than one thing has changed, and a blowout like this occurs, it's very time
consuming to even identify the culprit (except as in this case), guilt by association is established.
Next tiem I see a similar error message, I'll certainly lok for changes in the template file first.