-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: Parser - Equal key name replace conflict #9246
Conversation
Run Rector and cs fix:
also, a test case seems needed. |
You can rename PR title with |
@CosDiabos To ensure the security and authenticity of your commits, please sign all of them with GPG. This shows others that the commits were genuinely made by you and can be trusted. For a detailed guide on signing commits with GPG, please refer to gpg-signing-old-commits. |
Co-authored-by: Mostafa Khudair <[email protected]>
12aa04b
to
e1631ef
Compare
Thank you all for your help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CosDiabos Looks great! We need one last thing - a changelog entry.
Please add it under the Bugs Fixed section, here: https://github.com/codeigniter4/CodeIgniter4/blob/develop/user_guide_src/source/changelogs/v4.5.6.rst
Something like:
Parser: Fixed a bug that caused equal key names to be replaced by the key defined first.
Thanks.
@CosDiabos Thank you for your first contribution! |
Description
Fixes the conflict when replacing View Parser {variables} in the provided data with the same key name, even when on different levels.
This fix focus on
parse()
method, in which the return ofparsePair
andparseSingle
methods are stored independently , then merged together (Pairs with Single), and finally replaced. With this approach, the replacement happens from the Pairs to Single and the output is as expected.More details and examples in issue #9245
Fixes #9245
Checklist: