Find pdf file in CMS, not associated with page/block

Vote:
 

Hi!

A client has noticed that a pdf-file is listed in Google Search, which they wish to remove. From Google it links directly to the file itself. 

I was able to debug locally and through the url get the content link ID and its parent. The ID I then used in CMS to see/edit the file

https://mydomain.com/EPiServer/Cms/#context=epi.cms.contentdata:///12345&viewsetting=viewlanguage:///en

The file, nor its parent (media folder) is not associated to any page or block so if am not able to get any context menu to remove the file. 

I will try to move the parent (folder) to Global Media folder, but is there any way in the CMS that you could do any of this actions without debugging?

#270650
Jan 27, 2022 9:19
Vote:
 

Hello Jonas

It might be worth trying the "Remove Unrelated Content Assets" job as it sounds like the PDF got orphaned when some content was deleted: 

https://webhelp.optimizely.com/latest/en/content-cloud-for-administrators/scheduled-jobs.htm#RemoveUnrelatedContentAssets 

David

#270688
Jan 27, 2022 12:09
Jonas Boman - Feb 11, 2022 7:05
Woah! Thanks David. Sorry for the late reply.

"Checked that job out and it has been running weekly since forever, but is however throwing an error every time, so it seems:

The DELETE statement conflicted with the REFERENCE constraint "FK_tblContentProperty_tblContent2". The conflict occurred in database "DatabaseName", table "dbo.tblContentProperty", column 'ContentLink'."

Could you regognize what this is?
Vote:
 

Hey Jonas

Afraid I don't recognise that. But it's worth raising a ticket with support in case they can offer some advice or fixes. 

David

#271535
Feb 11, 2022 7:27
Vote:
 

A follow-up after some rounds with the support. 

This seems to be an issue with some unrelated content assets that has not been removed. The scheduled job "Remove Unrelated Content Assets" is broken så some issue in db. So kind of a snowball effect :) 

My next step is to do run SQL Profiler and run the job again to find out what is causing the issue in db.

Thanks David!

#272710
Feb 22, 2022 7:16
Vote:
 

Are  you able to see (and delete?) the PDF document from admin -> tools -> manage content?

#272717
Feb 22, 2022 8:39
Jonas Boman - Feb 22, 2022 11:09
Thanks for the tip.
No, I was not able to find the document, nor related pages, in this view.
Vote:
 

You could simply delete it from the database yourself....?

Step 1: optional remove the physical files from blob storage. Locate them using this query.

SELECT BlobUri, ThumbnailUri FROM tblContentLanguage WHERE fkContentId = 12345

Step 2: remove all traces from the database.

DELETE FROM tblContentProperty WHERE fkContentID = 12345
DELETE FROM tblWorkContentProperty WHERE fkWorkContentID IN (SELECT pkID FROM tblWorkContent WHERE fkContentID = 12345)
DELETE FROM tblWorkContent WHERE fkContentID = 12345
DELETE FROM tblContentLanguage WHERE fkContentId = 12345
DELETE FROM tblContent WHERE pkId = 12345

Use at your own risk, of course...

#272726
Feb 22, 2022 11:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.