Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22272

Image alias generator throws exception if original file is not present

    XMLWordPrintable

Details

    Description

      I get exceptions in dev and prod environments when trying to generate an alias for a image not existing in the disk.

      Easy to reproduce if you have an updated version of your database (you have dumped your prod db to your dev environment) and you don't have all the files in the dev environment

      Exception reads like this (prod.log)

      [2014-01-29 16:42:31] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Invalid variation 'line' for image") in "[ABUNDLE]:fields:ezimage_simple.html.twig"." at [...]/ezpublish/cache/prod/classes.php line 4465 {"exception":"[object] (Twig_Error_Runtime: An exception has been thrown during the rendering of a template (\"Invalid variation 'line' for image\") in \"[ABUNDLE]:fields:ezimage_simple.html.twig\". at /[...]/ezpublish/cache/prod/classes.php:4465, eZ\\Publish\\API\\Repository\\Exceptions\\InvalidVariationException: Invalid variation 'line' for image at /[...]/sb5/sillonbol/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Legacy/Image/AliasGenerator.php:93)"} []
      

      For creating the alias, legacy function is called. It seems that function doesn't return an array when the original file is not present and show the exception is thrown.

      Attachments

        Activity

          People

            Unassigned Unassigned
            desorden desorden
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 30 minutes
                5h 30m