Content Items Not Being Removed

Topics: Troubleshooting
Feb 18, 2011 at 9:17 PM

Here's an interesting one for ya:

I'm trying to remove a bunch of content items en masse from the db so I can re-import some data. To do so I do this:

var list = Services.ContentManager.Query(VersionOptions.AllVersions, "Video").List();
            foreach (var v in list) {

Doing so appears to do absolutely nothing. The records remain in the database and are completely unaffected by the Remove() call.


What am I missing?

Feb 18, 2011 at 9:22 PM

That the records stay in the database is normal: this is soft deletion. I think the change will be happening in ContentItemVersionRecord.

There is a feature request for a way to clean up the database if you want to vote it up:

Feb 18, 2011 at 10:42 PM

So what query should I be running that doesn't return the soft deleted items? They still appear in any query I run.

Feb 18, 2011 at 10:43 PM

From content manager? Are you using VersionOptions.Latest?

Feb 18, 2011 at 10:45 PM

I was using AllVersions