Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've got some code which I've realised isn't working correctly.
It was supposed to get me all content of a particular document type, but it doesn't get everything.
Excuse the vb.net code but any help is appreciated.
I'm on v7.5.13, importing pages from an older CMS, and yes, the missing pages have been correctly assigned the doctype I'm looking for.
Note that I've switched off the XML cache due to the size of my site.
Dim cs As IContentService = ApplicationContext.Current.Services.ContentService
Dim cts As IContentTypeService = ApplicationContext.Current.Services.ContentTypeService
Dim dt As Integer = cts.GetContentType("myDocType").Id
Dim d As IEnumerable(Of IContent)
d = cs.GetContentOfContentType(dt)
For Each doc As IContent In d
'some processing takes place here
'with the doc.Id etc, i.e. I'm adding the Id to a hashtable
Catch ex As Exception
Apologies, I'm being an idiot (again).
The For Each loop that built the hash table was bombing out on duplicates, something I had fixed but managed to unfix.
EDIT: ... and the Try Catch should have been inside the loop, at the point where the hash table was being added to.
Write your reply to:
Image will be uploaded when post is submitted