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

Volt parser embedding block error #12846

Closed
Akhundzada opened this issue May 13, 2017 · 4 comments
Closed

Volt parser embedding block error #12846

Akhundzada opened this issue May 13, 2017 · 4 comments
Labels
bug A bug report stale Stale issue - automatically closed status: low Low

Comments

@Akhundzada
Copy link

Akhundzada commented May 13, 2017

There is an issue when I have a keyword which is called as 'block' in my loops. Parser thinks that it's embedding block and throws an error:

Embedding blocks into other blocks is not supported in

/home/***/***/app/views/manager/article/edit.volt on line 170
#0 [internal function]: Phalcon\Mvc\View\Engine\Volt\Compiler->_compileSource('{% extends "bas...', false)
#1 [internal function]: Phalcon\Mvc\View\Engine\Volt\Compiler->compileFile('/home/*/***...', '/home/*/*...', false)
#2 [internal function]: Phalcon\Mvc\View\Engine\Volt\Compiler->compile('/home/*/*...')
#3 [internal function]: Phalcon\Mvc\View\Engine\Volt->render('/home/*/*...', Array, true)
#4 [internal function]: Phalcon\Mvc\View->_engineRender(Array, 'manager/article...', true, true, NULL)
#5 [internal function]: Phalcon\Mvc\View->render('article', 'edit', Array)
#6 /home/*/*/public/index.php(41): Phalcon\Mvc\Application->handle()
#7 {main}

Source code for reproduce:
base.volt

<div>{% block content %}{% endblock %}

child.volt

{% extends "base.volt" %}
{% block content %}

{% for block in article.block %}
...
{% endfor %}

{% endblock %}

Even if I change block to something else in one place, parser still throws error:

{% for b in article.block %}

So the working example looks like this:

{% for b in article.blockS %}

(with 's' on the end)

I think it's a bug.

@sergeyklay
Copy link
Contributor

sergeyklay commented May 13, 2017

It is not issue. As you can see in error message:

Embedding blocks into other blocks is not supported

Refs: https://github.com/phalcon/cphalcon/issues/329

@sergeyklay sergeyklay added the duplicate Duplicate issue. The duplicate issue is referenced in the comments label May 13, 2017
@Akhundzada
Copy link
Author

Akhundzada commented May 13, 2017

@sergeyklay But it's not a block.
Please read message carefully – I mention that my object has property which is called 'block'. And in this case parser thinks that it's part of block system.

@sergeyklay
Copy link
Contributor

Oh yeah, I see.

@sergeyklay sergeyklay reopened this May 13, 2017
@sergeyklay sergeyklay added Bug - Low and removed duplicate Duplicate issue. The duplicate issue is referenced in the comments labels May 13, 2017
@stale
Copy link

stale bot commented Apr 16, 2018

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

@stale stale bot added the stale Stale issue - automatically closed label Apr 16, 2018
@niden niden added bug A bug report status: low Low and removed Bug - Low labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report stale Stale issue - automatically closed status: low Low
Projects
None yet
Development

No branches or pull requests

3 participants