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

Preserve numeric keys on #each helper #18

Merged
merged 2 commits into from
Jan 10, 2023
Merged

Preserve numeric keys on #each helper #18

merged 2 commits into from
Jan 10, 2023

Conversation

inkarnation
Copy link
Contributor

Preserving numeric keys on #each helper, to maintain @key data variable functioning on int arrays

Assuming an array should be printed out like (enableDataVariables set to true):

{{#each arr}}
    {{ @key }}:   {{ this }}
{{/each}}

which was defined as

$arr = [
    '19' => 5
];

(key can be any integer)
The resulting @key variable was always printed as 0. array_slicein the helper function caused numeric keys to be set to 0 while maintaing string keys correctly. The pull request is enabling explicit key preserving, to fix such issue.

Preserving keyys on #each helper, to maintain @key data variable functioning on int arrays
@salesforce-cla
Copy link

salesforce-cla bot commented Dec 4, 2022

Thanks for the contribution! Before we can merge this, we need @inkarnation to sign the Salesforce.com Contributor License Agreement.

@sam-osborne sam-osborne merged commit 2a60abc into salesforce:master Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants