-
-
Notifications
You must be signed in to change notification settings - Fork 15
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 StatusClassRenderer implementation #92
Fix StatusClassRenderer implementation #92
Conversation
@phansys @core23 @VincentLanglet
This PR is RTM. Can you check it? |
@core23 @VincentLanglet @phansys @greg0ire Can you check it? |
9d06a91
to
29477bd
Compare
dc152d6
to
f83d4be
Compare
28c8ce4
to
cb4a9a6
Compare
Calling methods `handlesObject` and `getStatusClass` from `Sonata\Twig\FlashMessage\FlashManager` throw ErrorType exception after add type hints in `Sonata\Twig\Status\StatusClassRendererInterface` API. Update src/Extension/StatusRuntime.php Co-authored-by: Javier Spagnoletti <phansys@gmail.com> Update src/FlashMessage/FlashManager.php Co-authored-by: Javier Spagnoletti <phansys@gmail.com> Update src/Extension/StatusRuntime.php Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr> Update src/Extension/StatusRuntime.php Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr> Update tests/Extension/StatusRuntimeTest.php Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr> Update tests/Extension/StatusRuntimeTest.php Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
7014b3f
to
e95d5c7
Compare
Thank you @wbloszyk! |
I cant be certain because I don't fully understand how the engine works but I think there's a problem with StatusRuntime::statusClassForFlashManager that's included within this change. With this change my templates now render the flashes but the relevant css class is misssing for each flash type. I think it's down to the below code fragment. My suspicion is that the wrong parameter is being sent to
Sending
Is this a correct fix or am I missing some config somewhere else? |
@benrcole Look at https://github.com/sonata-project/twig-extensions/blob/1.x/docs/reference/status_helper.rst Can you open issue for this with reproduction information? Im also working on #90 where using StatusClassRenderer and FlashManager will be more obvius. |
I have opened #93 with reproducible steps |
Subject
After add type hints in
Sonata\Twig\Extension\StatusRuntime
get status class from string (flash massage type) is not possible andTypeError
is throwed. This PR fixStatusClassRendererInterface
implementation inFlashManager
and remove some type hints which make BC-break.I am targeting this branch, because this change respect BC.
Closes #89.
Changelog