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

Twig variable parsing has issue. Can't assume "name" attribute exists for every node/expression #315

Open
DiegoPino opened this issue Jun 4, 2023 · 3 comments
Assignees
Labels
bug Something isn't working Custom Entities
Milestone

Comments

@DiegoPino
Copy link
Member

What?

There are many Twig compiler expressions that don't have certain properties. I already found a few (e.g Binary Operators). Checking on each class type makes no sense and getting a name attribute when non-existent throws an exception. The proper way is to use the method twig provides to see if a property exist. @aksm pulling code now and merging in a few bc this blocks any template that uses binary operators (and many other I have never used).

@patdunlavey
Copy link
Collaborator

Thanks so much for identifying the source of this problem @DiegoPino . I puzzled at it for a while without realizing that the issue might be in Archipelago code. (I assumed it was a Twig version thing.)
FYI, I've also seen this error reporting a problem with the "value" attribute. I'll see if I can find steps to reproduce that.

@aksm
Copy link
Contributor

aksm commented Jun 5, 2023

Thanks @patdunlavey. Testing and looking into this now. And yes, please report back on the "value" attribute. I'll see if I can reproduce as well.

@aksm
Copy link
Contributor

aksm commented Jun 5, 2023

Hi @DiegoPino, can you share an example of an expression that fails? I'm having trouble reproducing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Custom Entities
Projects
None yet
Development

No branches or pull requests

3 participants