We have an application that is going through a number of the Components in one Publication (the Source) and if they are published to a specific Publication Target, publishing them to another Publication (the Destination).
The application works fine for the majority of Components however we noticed it was missing about 1/3 of the Components from the Source we had expected it to pick up. At first glance it appears that when the application checks to see if a Component is published in the Source Publication it sometimes gets back False for Components that are actually published.
Here is a snippet of code similar to what we're doing in our app:
static SessionAwareCoreServiceClient CORE_SERVICE =
new SessionAwareCoreServiceClient("netTcp_2011");
using (var client = CORE_SERVICE) {
if (client.IsPublished("tcm:10-259165", "tcm:0-3-65537", true)) {
// Do some stuff
}
}
So the interesting thing is that when we go to one of these Component in the Source Publication, the GUI shows the icon indicating it is published:
But when we do a 'Where Used' on the Component in that Publication it shows it as not published anywhere:
Then, when we run a query against the CM database select * from item_states where item_reference_id = 259165
we get back a number of results showing the Component does have some Templates Published to the target in question (Publication Target '3'):
And finally, we can of course see the Component Presentations for this Component published to the Content Delivery DB for the target in question.
Any idea what might be going on here? It has me flummoxed and while we have a work around (just get the list of Components from the Content Delivery DB) we would like to understand what is going on and if it might be an indication of something going wonky with our CM DB or not.