Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterating Lists using STRawGroupDir exception: context [template] 1:1 no such template: /_sub1 #5

Closed
rapodaca opened this issue Mar 1, 2012 · 3 comments
Assignees

Comments

@rapodaca
Copy link

rapodaca commented Mar 1, 2012

There seems to be a bug in 4.0.5 in iterating Lists when using STRawGroupDir. See this Unit test:

https://gist.github.com/1943633

The first test behaves as expected. The second throws an error. I expected both tests to pass.

@ghost ghost assigned parrt Mar 2, 2012
@parrt
Copy link
Member

parrt commented Mar 3, 2012

thanks. I'm notSure when I can get to this, but it should be an easy fix.
Ter
On Mar 1, 2012, at 9:29 AM, Richard Apodaca wrote:

There seems to be a bug in 4.0.5 in iterating Lists when using STRawGroupDir. See this Unit test:

https://gist.github.com/1943633

The first test behaves as expected. The second throws an error. I expected both tests to pass.


Reply to this email directly or view it on GitHub:
#5

@pgelinas
Copy link

I've hit the same problem and did some code hunting to see what was going on. Here's what I've found, thought it might help you resolve the issue:

STRawGroupDir overrides STGroup.loadTemplateFile to enables non-formal parsing. But, during formal parsing with GroupParser in the initial method, the parser does a callback to STGroup via the defineTemplateOrRegion method. This method then calls defineTemplate, which compiles the template, stores it in the templates variable and stores any implicitly defined template (such as anonymous template).

The problem with STRawGroupDir is not that it can't handle this kind of construct, but it doesn't do any caching at all of any previously defined template and will re-parse them every time. The fix should be trivial in STRawGroupDir: just ensure that the compiled template are stored in the group.

Hope this helps.

@parrt
Copy link
Member

parrt commented Aug 13, 2012

Thanks. That will make a quick fix possible.

parrt added a commit that referenced this issue Aug 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants