-
Notifications
You must be signed in to change notification settings - Fork 379
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 crash when no post processor is defined #526
Conversation
@@ -141,6 +141,10 @@ public function apply(BinaryInterface $binary, array $config) | |||
*/ | |||
public function applyPostProcessors(BinaryInterface $binary, $config) | |||
{ | |||
if (!isset($config['post_processors'])) { | |||
return $binary; | |||
} |
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.
Maybe it would be better to properly configure it in Configuration.php or DI Extension.
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.
We will fix this in eZ for sure, in order to support post processors. But this shouldn't break if you don't have any configured.
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.
I meant to fix it in LIipImagineBundle, not your code. The configuration or di extnesion of this bundle. The place where filter manager service is configured.
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.
Ah ok, sorry misunderstood. Yeah you're probably right, but this check is mandatory anyway since this method is public and we cannot predict what's in $config
. So this is an open door for bugs :)
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.
@lolautruche public.... okay lets keep it here. Could you add a test for this case?
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.
Sure, give me a few minutes (I opened this PR using web 😄 )
this will indeed solve the issue. we could solve it in the eZ side too, but to me this is better place to solve. I guess some other projects using Liip can experiment this issue too... |
@crevillo We need to fix this on the eZ side as well, if we want to support post processors in the config. |
yes. definitely. and it would be good if we can find a way to addopt possible new features added to Liip without the need to touch eZ code ;) |
Exception: > ContextErrorException: Notice: Undefined index: post_processors in /var/www/foo/vendor/liip/imagine-bundle/Liip/ImagineBundle/Imagine/Filter/FilterManager.php line 144 This happens in eZ Publish, where post processors are not (yet) supported. Ping @crevillo
Updated code with a better way to add default value for |
Fix crash when no post processor is defined
Thanks |
Thank you so much @makasim ! |
this indeed fix the problem in eZ 5 side too. Even eZ 5 won't support post_processors yet. Thanks @makasim and @lolautruche |
Exception:
This happens in eZ Publish, where post processors are not (yet) supported.
Ping @crevillo