This is probably a real edge case, but worth noting given content can be lost from a website. Might be worthwhile someone else trying to reproduce.
While troubleshooting failure of the 'Remove Unrelated Content Assets' job, I found a situation where content displayed on a site will be deleted by the job. Steps to reproduce in Alloytec aren't exactly straightforward, but this issue could be bigger for some sites that have used the Url property for images more extensively. I.e., from Alloytec:
public class SiteLogotypeBlock : SiteBlockData { /// <summary> /// Gets the site logotype URL /// </summary> /// <remarks>If not specified a default logotype will be used</remarks> [DefaultDragAndDropTarget] [UIHint(UIHint.Image)] public virtual Url Url ...
}
Steps to reproduce (using Alloytec on Optimizely/Epi v11.15):
Create a new 'Standard Page' under the Start page, let's call it 'Page 1'. Publish it.
While editing the new page, go to the Assets Pane, click on 'For this Page' > Media and upload an image called something like 'new-logo.png'. The idea is to upload an image into the 'Content Asset Folder' that is owned by 'Page 1'
Under the Root page, create a new 'Start' page, let's call it 'New Alloytec home page'
Click on the Site Settings tab
Click on Logotype > Url to choose an image for the site logo
In the 'Select Image' dialog, search for 'new-logo'. The logo uploaded to Page 1 will appear. Select it and publish the page
Go to Admin > Config tab > Manage websites
Click on the Alloytec site name
In the General section, change the Start page to the 'New Alloytec home page' created in step 3
Save the changes and open the new home page. You should see a page with the new logo in the top left
Go back to Edit mode and delete the standard page 'Page 1' created in step 1 (Move to Trash)
View Trash and permanently delete 'Page 1'
Go to Admin > Admin tab > Scheduled jobs > Remove Unrelated Content Assets > Start Manually
Click on the History tab - it should state that 1 unused content asset folders have been deleted
Go back to the new home page and refresh.
The new logo should have vanished from the new site
So, not sure if this issue will impact many, but might be good to prevent images etc from showing in the 'Select image' dialog when they're stored in a Content Asset Folder for another page, so these cross-references can't be created in the first place.
In other words, the Select image search should only show images stored in Global assets, Site assets or the Content Asset folder owned by the content being edited.
I also wonder if the scheduled job can be updated to take these types of references into account?
This is probably a real edge case, but worth noting given content can be lost from a website. Might be worthwhile someone else trying to reproduce.
While troubleshooting failure of the 'Remove Unrelated Content Assets' job, I found a situation where content displayed on a site will be deleted by the job. Steps to reproduce in Alloytec aren't exactly straightforward, but this issue could be bigger for some sites that have used the Url property for images more extensively. I.e., from Alloytec:
Steps to reproduce (using Alloytec on Optimizely/Epi v11.15):
So, not sure if this issue will impact many, but might be good to prevent images etc from showing in the 'Select image' dialog when they're stored in a Content Asset Folder for another page, so these cross-references can't be created in the first place.
In other words, the Select image search should only show images stored in Global assets, Site assets or the Content Asset folder owned by the content being edited.
I also wonder if the scheduled job can be updated to take these types of references into account?
Thanks