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

Exception when loading content with image with '/images-versioned/' path

    Details

    • Sprint:
      Castor Core S1

      Description

      It affects the PreviewController, leading to an exception when previewing content with an image.

      To reproduce on an install with DemoBundle:

      1. Create a article in the backoffice
      2. Set the title and abstract, and select an image
      3. Hit preview in the left column

      eZ\Publish\Core\Base\Exceptions\InvalidArgumentException: Argument '$id' is invalid: Prefix images not found in images-versioned/1185/1-eng-GB/EZP-223401.jpg
          at n/a
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/IO/IOService.php line 357
       
          at eZ\Publish\Core\IO\IOService->removeUriPrefix('images-versioned/1185/1-eng-GB/EZP-223401.jpg')
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/IO/IOService.php line 248
       
          at eZ\Publish\Core\IO\IOService->getExternalPath('var/ezdemo_site/storage/images-versioned/1185/1-eng-GB/EZP-223401.jpg')
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/FieldType/Image/ImageStorage.php line 214
       
          at eZ\Publish\Core\FieldType\Image\ImageStorage->getFieldData(object(VersionInfo), object(Field), array('identifier' => 'LegacyStorage', 'connection' => object(eZPublishCorePersistenceDoctrineConnectionHandler_0000000064396b14000000005650cdd6)))
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/StorageHandler.php line 95
       
          at eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler->getFieldData(object(VersionInfo), object(Field))
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/FieldHandler.php line 340
       
          at eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler->loadExternalFieldData(object(Content))
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php line 330
       
          at eZ\Publish\Core\Persistence\Legacy\Content\Handler->load('214', '1', array('eng-GB'))
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/ContentHandler.php line 64
       
          at eZ\Publish\Core\Persistence\Cache\ContentHandler->load('214', '1', array('eng-GB'))
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php line 379
       
          at eZ\Publish\Core\Repository\ContentService->internalLoadContent('214', array('eng-GB'), '1')
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php line 325
       
          at eZ\Publish\Core\Repository\ContentService->loadContent('214', array('eng-GB'), '1')
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/SignalSlot/ContentService.php line 191
       
          at eZ\Publish\Core\SignalSlot\ContentService->loadContent('214', array('eng-GB'), '1')
              in /home/bertrand/ezpublish5/app/cache/dev/appDevDebugProjectContainer.php line 21554
       
          at eZPublishCoreRepositoryContentService_0000000064396bc7000000005650cdd6->loadContent('214', array('eng-GB'), '1')
              in /home/bertrand/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/Controller/Content/PreviewController.php line 74
       
          at eZ\Publish\Core\MVC\Symfony\Controller\Content\PreviewController->previewContentAction('214', '1', 'eng-GB', 'ezdemo_site_user')
              in  line 
       
          at call_user_func_array(array(object(PreviewController), 'previewContentAction'), array('214', '1', 'eng-GB', 'ezdemo_site_user'))
              in /home/bertrand/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 117
       
          at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
              in /home/bertrand/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 61
       
          at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
              in /home/bertrand/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php line 62
       
          at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
              in /home/bertrand/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 187
       
          at Symfony\Component\HttpKernel\Kernel->handle(object(Request), '1', true)
              in /home/bertrand/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Kernel.php line 67
       
          at eZ\Bundle\EzPublishCoreBundle\Kernel->handle(object(Request))
              in /home/bertrand/ezpublish5/app/web/index.php line 79
      

      Most likely caused by the 'images-versioned' path item instead of 'images'. The new stack doesn't know at all about this prefix.

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment - - edited
          Show
          Bertrand Dunogier added a comment - - edited Pull-request https://github.com/ezsystems/ezpublish-kernel/pull/828 .
          Hide
          Bertrand Dunogier added a comment -
          Show
          Bertrand Dunogier added a comment - Merged to ezpublish-kernel/master@235b4c7c .
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

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

          There won't be a "new fix", since the bug we're facing doesn't come from images handling. It's a preview bug.

          Show
          Bertrand Dunogier added a comment - There won't be a "new fix", since the bug we're facing doesn't come from images handling. It's a preview bug.
          Hide
          Bertrand Dunogier added a comment -

          Created EZP-23040.

          Show
          Bertrand Dunogier added a comment - Created EZP-23040 .
          Hide
          Bertrand Dunogier added a comment -

          Sorry about that, here it is Paulo.

          Show
          Bertrand Dunogier added a comment - Sorry about that, here it is Paulo.
          Hide
          Paulo Nunes (Inactive) added a comment -

          QA Approved also for EZ Publish 5.2

          Summary:
          For eZ Publish 5.2, this issue might be divided in two parts:

          • one when using the preview on left panel,
          • and other when using the preview from eZ Autosave.

          We will consider the scope of the current issue within the first part i.e, when using the preview button on left panel.Solved with the patch included as attachment in the current issue.
          For the use of preview button from eZ Autosave toolbar, there is an exception that will be resolved in EZP-23040. Being so, it's not in the scope of the current approval.

          Show
          Paulo Nunes (Inactive) added a comment - QA Approved also for EZ Publish 5.2 Summary: For eZ Publish 5.2, this issue might be divided in two parts: one when using the preview on left panel, and other when using the preview from eZ Autosave. We will consider the scope of the current issue within the first part i.e, when using the preview button on left panel.Solved with the patch included as attachment in the current issue. For the use of preview button from eZ Autosave toolbar, there is an exception that will be resolved in EZP-23040 . Being so, it's not in the scope of the current approval.
          Hide
          Bertrand Dunogier added a comment -

          That's right

          (regression from the preview feature backport)

          Show
          Bertrand Dunogier added a comment - That's right (regression from the preview feature backport)

            People

            • Assignee:
              Unassigned
              Reporter:
              Bertrand Dunogier
            • Votes:
              0 Vote for this issue
              Watchers:
              6 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 - 1 day, 30 minutes
                1d 30m

                  Agile