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

image aliases not restored when restoring object from trash

    XMLWordPrintable

Details

    Description

      When restoring from trash an object with image attribute that has more than one version, the image aliases are not restored, and the filesystem gets bloated with multiple "trashed" folders and multiple hard links to the same file.

      In my case it created more than 7000 hard links to the same file!

      P.S. This is probably a bug in kernel/classes/datatypes/ezimage/ezimagetype.php, trashStoredObjectAttribute() function, because it's the only place where the "trashed" folder is mentioned.

      Steps to reproduce
      • create some object that has an image attribute, upload an image in the attribute and publish it
      • reedit the object and change something that doesn't change the objects name
      • move the object to trash - here's the first bug, "medium" alias version of the image is not removed
      • restore the object from trash

      The result is:

      • the "trashed" folder that was created when moving the object to trash is not deleted
      • the image and it's alias versions are not restored back to the version's folder of the image
        (in admin the image url points to a non-existing image)
      • the files structure gets like this:
        storage/images/trashtest/59884-1-cro-HR
          |- trashed
          |   |- 6da0f711bb05c3241d5e4ddc8f577387.jpg
          |   |- 6da0f711bb05c3241d5e4ddc8f577387_large.jpg
          |   |- 6da0f711bb05c3241d5e4ddc8f577387_reference.jpg
          |   |- 6da0f711bb05c3241d5e4ddc8f577387_medium.jpg
          |   |- d587555b48b3567d9828c80922ffa69e_medium.jpg
          |   |- trashed/
          |      |- 66cd89c1e9779c08419bd87f5f5f5d50_medium.jpg
          |- trashtest_medium.jpg
        

      Attachments

        Activity

          People

            jv@ez.no jv@ez.no
            zmak zmak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: