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

rendering with strict=true does not throw for missing nested variables in context #23

Open
hubermat opened this issue Oct 6, 2023 · 0 comments · May be fixed by #24
Open

rendering with strict=true does not throw for missing nested variables in context #23

hubermat opened this issue Oct 6, 2023 · 0 comments · May be fixed by #24

Comments

@hubermat
Copy link

hubermat commented Oct 6, 2023

When I have the following nested context:

[
  'person' => [
    'firstName' => 'Foo',
    'lastName' => 'Bar',
    'zip' => '12345'
  ]
]

and want to get variables from this context with strict checking (should throw an exception, if the variable does not exist), it throws an exception correctly for $context->get('bogusvariable', true), but not for $context->get('person.city', true).
From looking at the code, I found out that for nested variables the check for $strict is missing in Context::findVariableInContext.

Linked pull request fixes this issue.

@hubermat hubermat linked a pull request Oct 6, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant