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: Guard that Fusion path cannot be empty #4547

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Sep 21, 2023

Previously in php 7.4 this Neos\Fusion\Exception\MissingFusionObjectException was thrown

No Fusion object found in path ""

but with php 8 this ValueError is thrown which is unexpected

strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

This change takes care of throwing an explicit Neos\Fusion\Exception instead:

Fusion path cannot be empty.


This error was noticed in the out of band rendering, when there is no content element wrapping: https://discuss.neos.io/t/argument-3-offset-must-be-contained-in-argument-1-haystack/6416/4

image

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

Previously in php 7.4 this `Neos\Fusion\Exception\MissingFusionObjectException` was thrown

> No Fusion object found in path ""

but with php 8 this `ValueError` is thrown which is unexpected

> strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

This change takes care of throwing an explicit `Neos\Fusion\Exception` instead:

> Fusion path cannot be empty.
@jonnitto jonnitto merged commit f2fb774 into 7.3 Sep 22, 2023
8 checks passed
@jonnitto jonnitto deleted the bugfix/guardFusionPathNeverEmpty branch September 22, 2023 09:04
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.

3 participants