Getting rid of orphan article elements after articles were purged

Build 1501 on 14/Nov/2017  This topic last edited on: 24/Oct/2016, at 13:00

In some situations, orphan article elements can remain in database after articles are purged (as explained in Photocaptions survive article deletion), and prevent purging of linked images.

You may want to get rid of such orphan elements, but it is better not to use SQL queries, as elements data is spread across many tables and incomplete deletions can leave "dirty" data.

This topic explains step-by-step how to build a XPath expression to clean such orphans, both article elements and referenced images.

Let's start with an article that has a photoCaption element and a linked image. Open the article in Ted4, open the photoCaption element and then display its properties. On the Info tab find the ID of the photoCaption article element. Let's assume the ID is 130031.

Click to toggle graphic sizeBuild XPath by looking into a regular photoCaption
Click to toggle graphic sizeUse a script to get ids of all orphan elements
Click to toggle graphic sizeSave the content of orphan items before deleting them
Click to toggle graphic sizeSpike orphan items by srv4