rendering with strict=true does not throw for missing nested variables in context
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
Research direction
Start at Context::findVariableInContext and compare its nested-variable handling with Context::get('bogusvariable', true). Verify the referenced pull request before starting work; done means a missing nested variable under strict checking throws the expected exception while existing nested lookups continue to work.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- PHP
- Stars
- 77
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from salesforce/handlebars-php
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
salesforce/handlebars-php#32 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
salesforce/handlebars-php#25 · 2 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
salesforce/handlebars-php#22 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
salesforce/handlebars-php#21 · 1 comment · 4 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
salesforce/handlebars-php#11 · 1 comment ·
All issues in salesforce/handlebars-php
Similar issues
-
bug good first issue small
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
open-telemetry/opentelemetry-php#2164 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Перевод устарел
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day