-
Type: Bug Report
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.1.0
-
Fix Version/s: 5.2.0-B1
-
Component/s: Data Management
-
Labels:
-
External issue URL:
-
Additional information:
-
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:
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.