4

We had a Core Service script running that left thousands of Components checked out.

I would like to fix this with another script based on Robert's example (http://www.curlette.com/?p=1095). I don't see errors but nothing seems to happen. Is there something else I can try?

Update

My simple script (used with LINQPad)

RepositoryLocalObjectsFilterData filter = new RepositoryLocalObjectsFilterData();  
XElement checkedOutItemsXml =Tridion.GetSystemWideListXml(filter);  
checkedOutItemsXml.Nodes().Count().Dump();  
ReadOptions ro = new ReadOptions();  
ro.LoadFlags = LoadFlags.Expanded;  

foreach (XElement tridionItem in checkedOutItemsXml.Nodes())  
{  
    if (tridionItem.Attribute("Type").Value == "16" || tridionItem.Attribute("Type").Value == "64")  
    {  
        VersionedItemData response = Tridion.CheckIn(tridionItem.Attribute("ID").Value, ro);  
    }  
}
10
  • 1
    Do you have Workflow enabled on the system? If so, then maybe they're now in Workflow process. You could try the client.UndoCheckOut() method. Are you running the new script as an admin user? Can you 'manually' undo the checkout (or check-in) on these items successfully? Dec 20, 2017 at 11:39
  • "nothing seems to happen" ... does the additional logging that I presume you've added to give you more information ... log? Dec 20, 2017 at 11:55
  • Under what credentials is the Core Service script run? Since you have to be an Administrator to be able to override a checkout (and I suggest to use the UndoCheckOut instead indeed). Dec 20, 2017 at 12:05
  • Thanks for your replies. I'm running the script as Administrator. Also we don't have a workflow enabled. UndoCheckout is not working and i think the effect will be that the changes done by the previous script will be gone. I can check Components in manually. Dec 20, 2017 at 12:44
  • Additionally - CheckinAsync isn't even working. The problem is that we have to update alot of components (thousands of them) and Checkin does not give any error (indeed being an Admin it should not), but checkin does NOT actually checks-in.. Also consider that the components are big and until the last components gets checked in, another is fired for checkin. so not sure if that is not letting the components get checked in. Dec 20, 2017 at 13:00

1 Answer 1

3

Bart was right, we used ICoreService2011.CheckIn. With ICoreService2013.CheckIn the script from Vikas worked fine. Will update the Linqpad driver, to avoid these kind of questions in the future...

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.