ezsystems/ezpublish-kernel — pull request #706 by crevillo (2014-01-29 20:00:43+00:00)
Title: Fix EZP-22272: Image alias generator throws exception if original file i...

...s not present

Proposed solution is based on the one added in https://github.com/ezsystems/ezpublish-kernel/pull/473, but probably can be solved somewhere else.

What i've done is just change the throw exception part for a log error part.
Also, i've modified the default ezimage_field template. If not, another exception is thrown telling you have no uri for imageAlias.

I think this exception is thrown because there's no check for the existence of the original file when you call the ezimage_alias_field twig function https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php#L431

AliasGenerator calls legacy function to create the alias and if the thing doesn't go well, it returns null. This could be because a non existent original file, and permission problem or maybe a cracks in the image converter.

As said, this could be probably solved somewhere else, maybe checking the existence of the original file, but that will add a filestat call though...