Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-928

Images are deleted during link approval process

    XMLWordPrintable

    Details

    • Additional information:
      Hide

      Another small problem here - such links (that needed to be approved) have broken icon in catalog. They should have Pending icon I suppose.

      Show
      Another small problem here - such links (that needed to be approved) have broken icon in catalog. They should have Pending icon I suppose.
    • Change Log Message:
      Fixed image delete on link approve (when LINK.OWNER.MODIFY.PENDING permission was used)
    • Story Points:
      2
    • External issue ID:
      1142
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      There are 2 category permissions:

      • LINK.OWNER.MODIFY - changes, user makes to it's link are immediately seen on Front-End
      • LINK.OWNER.MODIFY.PENDING - changes, user makes to it's link are stored in another link record for admin to approve/decline

      When user has LINK.OWNER.MODIFY permission it works, like a charm. However, there are a problems in creating a link, that contains all changes made by user.

      All files are copied normally. Images are also copied on disk (e.g. image_one.jpg will be copied to image_one_1.jpg), but original image filename stays in link record.

      This way approving a link will delete all it's images from disk keeping broken records in Images table.

      Since images are copied at least, then I suppose it's working partially. Then we need to ensure, that copied image filenames are put back into Images table record associated with the link, that will hold all modifications.

      What to fix:
      ============
      1. Place approved link ResourceId into Listings db table (link enhancements) & Relationship db table (link relationships) instead of original link (link before change) ResourceId (remember ResourceId before deleting original link).

      2. make sure, that copied image filenames are listed in "link to be approved" database record (instead of original link image filenames).

      3. remove "1" (or any "[\d]+$") from approved link image filenames (when this way fixed filename won't match to any existing filename in same folder), once link was approved.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                phil Phil Banks
                Developer:
                Erik Snarski [Intechnic]
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: