Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-2464

ibexa:images:normalize-paths stops on empty ezimage fields

    XMLWordPrintable

Details

    Description

      The ibexa:images:normalize-paths will stop processing when reacing empty ezimage fields. That is objects contains ezimage attributes where the user have not uploaded any image.
      In that case, the data_text column will be NULL and you'll get the following error

      In NormalizeImagesPathsCommand.php line 171:
        DOMDocument::loadXML() expects parameter 1 to be string, null given
      

      There following code don't take into account that data_text might be null : https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.14/eZ/Bundle/EzPublishCoreBundle/Command/NormalizeImagesPathsCommand.php#L171

      How to reproduce

      1. Comment out the following lines https://github.com/ezsystems/ezpublish-kernel/blob/7.5/eZ/Publish/Core/IO/FilePathNormalizer/Flysystem.php#L29-L36.
      2. Create an image content, but do not upload any image - see remark below.
      3. Revert Flysystem.php to original state
      4. Run console command php bin/console ibexa:images:normalize-paths

      Remarks (MSz): The last version of the image content item needs to be empty. So at least one previous version of the content item needs to contain an image file. Completely blank image content items do not reproduce the issue.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              vidar.langseid@ibexa.co Vidar Langseid
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: