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

    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.

        Issue Links

          Activity

          Hide
          Carlos Revillo added a comment -

          My proposal is log the error as it was done in
          https://github.com/ezsystems/ezpublish-kernel/pull/473 and https://github.com/ezsystems/ezpublish-kernel/pull/449
          (Thanks Gaetano for the links)

          Show
          Carlos Revillo added a comment - My proposal is log the error as it was done in https://github.com/ezsystems/ezpublish-kernel/pull/473 and https://github.com/ezsystems/ezpublish-kernel/pull/449 (Thanks Gaetano for the links)
          Show
          Carlos Revillo added a comment - Fixed in https://github.com/ezsystems/ezpublish-kernel/pull/706
          Show
          Jérôme Vieilledent (Inactive) added a comment - - edited https://github.com/ezsystems/ezpublish-kernel/commit/c1a5bcd4c93d76ba6331d5b7b39919d0d6b5e32b
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

          Show
          Marcos Loureiro (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Carlos Revillo
            • 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