November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
This is a great write up! I would encourage you to blog this as an article!
Apologies for the long post. We've encountered the 'Remove Unrelated Content Assets' FAILED error, previously documented here and here. I've done some investigation and interested in getting some feedback on a possible workaround using a scheduled job to log issues or optionally move content.
The issue may have been somewhat addressed in a fairly recent update? - 12.1.0: https://world.optimizely.com/support/bug-list/bug/CMS-18001 , however upgrading to version 12 may not be an immediate option in our case.
In troubleshooting, I've found that the issue is easily recreated in Alloytec using fairly standard authoring steps (documented below). Basically, the edit interface allows an author to create a cross-reference to content that is stored in another page's content asset folder.
I've also found another issue where the 'Remove Unrelated Content Assets' job will delete content in use on the website. Again, this can be reproduced in Alloytec but is a bit of an edge case. It may be a bigger issue for some sites depending on certain property type usage, so I've submitted a separate post here.
Firstly, to create the cross-reference issue in Alloytec (v11.15, issue also replicated in a site running v11.20.9):
This blog post helped to start identifying content stopping the job: https://world.optimizely.com/blogs/Antti-Alasvuo/Dates/2021/3/remove-unrelated-content-resources-scheduled-job-failing/ . However, it quickly became apparent we have lots of these cross-references stopping the job. I investigated the 'Force Delete' option, but in our case, some of the content was still in use. This is the same as the situation created in the Alloytec site above. Doing a force delete on the Alloytec site db using the stored proc will result in the 'logo' image disappearing from the Start page.
So I tried another option which seems to work okay, but I'm keen to get some feedback in case there are other issues to consider. I haven't run this in PROD yet!
Ultimately I had a closer look at the tblContent table. It appears that only content asset folders have a value for the 'ContentOwnerID' field.
I used this SQL to return all Content Asset Folders that have been orphaned (their owner page deleted):
Using this list of ids, I could then retrieve all the references to the content contained in these folders. In the end I created the following scheduled job, that can either just print out a list of troublesome content for manual intervention, or optionally move that content programmatically to a Global Asset folder that has been created specifically in Edit mode. Once the cross-referenced content was moved, the Remove Unrelated Content Assets scheduled job started successfully.