Passing params down template/partial levels #196

Open
richard-ive opened this Issue Nov 21, 2012 · 3 comments

Projects

None yet

3 participants

@richard-ive

I have an issue where a partial causes a body function to call it's self recursively causing Chrome and Firefox to throw a 'RangeError: Maximum call stack size exceeded'.

This is the hierarchy of partials I have:

parent template:

{>"start_to_end_date" label="Dates:"        name="propertydates" id="propertydates" value="" type="text" size="input-small" data="data-required='required'"/}

start_to_end_date

{>"input_text" id="{id}x"/}

note: {id} is from first template

input_text

<input type="text" id="{id}" name="{name}" {data} class="{size} include {classes}" value="{value}" />

note: {id} is from start_to_end_date

I have debugged the code and found that at the point where {id} is passed from start_to_end_date into input_text it is already a body_4 function which has obviously been complied. So when {id} is read inside input_text the context key id is a function in the tail.head of body_4. So, as the context is not reset it continues passing the id of body_4, and therefore keeps calling its self until the browser throws a warning.

Sorry if I've note explained this very well, i'll try again if needs be. It could be that I'm using partial parameters in the wrong way, but I wanted to check first.

Thanks.
Rich

@vybs
Contributor
vybs commented Nov 21, 2012

@rragan there is a duplicate ticket for this already.

@rragan
Contributor
rragan commented Nov 21, 2012

Veena, Did you mean to comment to me? I wasn't involved in this thread.

@vybs
Contributor
vybs commented Nov 21, 2012

@rragan oops!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment