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

Not render block that does not exist #1614

Closed
wants to merge 2 commits into from

Conversation

eerison
Copy link
Contributor

@eerison eerison commented Sep 19, 2022

Not render block that does not exist

I am targeting this branch, because it requires a fix in sonata block bundle 4.x and it's supported only for page bundle 4.

Issue #1609.

Changelog

### Fixed
- Skipping blocks that doesn't exist from the page.

@eerison eerison changed the base branch from 3.x to 4.x September 19, 2022 14:27
@eerison eerison marked this pull request as draft September 19, 2022 14:28
@@ -26,7 +26,7 @@
"doctrine/doctrine-bundle": "^2.5",
"doctrine/persistence": "^2.1 || ^3.0",
"sonata-project/admin-bundle": "^4.15",
"sonata-project/block-bundle": "^4.16.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'll be fixed after this PR sonata-project/SonataBlockBundle#1115 pass

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I need this PR :/

Copy link
Member

Choose a reason for hiding this comment

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

@eerison eerison force-pushed the fix-creash-block-in-page branch 3 times, most recently from b4fd8a3 to cb75366 Compare September 19, 2022 14:39
@eerison eerison force-pushed the fix-creash-block-in-page branch from cb75366 to 2527c7e Compare September 19, 2022 14:40
@eerison eerison marked this pull request as ready for review September 19, 2022 14:42
@eerison
Copy link
Contributor Author

eerison commented Sep 20, 2022

I'll expect what gonna be decided in this PR: sonata-project/SonataBlockBundle#1115

@eerison eerison marked this pull request as draft September 20, 2022 09:04
@eerison
Copy link
Contributor Author

eerison commented Sep 22, 2022

Hey @VincentLanglet @jordisala1991
do you think that we could handle this issue with this approach, or do we must use exception strategy from block bundle?

return '';
}

return $this->blockHelper->render($block, $options);
Copy link
Member

Choose a reason for hiding this comment

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

You can try/catch only the render call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I can do that!

}

return $this->blockHelper->render($block, $options);
} catch (BlockNotFoundException $exception) {
Copy link
Member

Choose a reason for hiding this comment

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

Why BlockNotFoundException ?

I thought we introduced a BlockServiceNotFoundException ; you need to catch something else ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's the old exception I need to change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants