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

BUGFIX: props will be unset after an exception #4526

Merged
merged 1 commit into from Oct 30, 2023

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Sep 17, 2023

Resolves: #4525

The rendering in a Neos.Fusion Component had a bug where the props might be undefined if an exception happened earlier in an eel expression.

This was caused by not correctly poping the runtimes context and thus causing a unexpected shift in the context stack.

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@mhsdesign mhsdesign linked an issue Sep 20, 2023 that may be closed by this pull request
Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see some more explanation or even a test that fails without the fix, but it seems like a sensible change!

@mficzel mficzel merged commit 98d2ce9 into 7.3 Oct 30, 2023
12 checks passed
@mficzel mficzel deleted the bugfix/4525-fusion-exceptionhandling-and-lazyprops branch October 30, 2023 10:09
@Benjamin-K
Copy link
Contributor

I know, this is already merged. But shouldn't the context be popped again in any case?

try {
    // New implementation, return will immediatly stop
    // return $this->runtime->render($this->path . '/renderer');
    // Should be this IMO
    $result = $this->runtime->render($this->path . '/renderer');
} finally {
    // This will never be triggered if return is used above
    $this->runtime->popContext();
}
// Return should be used after popContext()
return $result;

@mhsdesign
Copy link
Member Author

hi :D no thats fine because finally is really cool. Its the same. finally ALWAYS happens even if there is a return. Super cool right :D

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.

Fusion exception handling doesnt work with lazy props
5 participants