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);  
    }  
}
  • 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? – Jonathan Williams Dec 20 '17 at 11:39
  • "nothing seems to happen" ... does the additional logging that I presume you've added to give you more information ... log? – Dylan .. Mark Saunders Dec 20 '17 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). – Bart Koopman Dec 20 '17 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. – Minko Scheltinga Dec 20 '17 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. – Vikas Kumar Dec 20 '17 at 13:00

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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