Auto undo check out page

david ndlovu asked on October 9, 2019 11:57

Hi Kentico

I went through k12 documentation trying to find out if I could undo a checkout automatically after a period has elapsed, but only found information to set up check out/in pages.

I would appreciate your response.

Best regards David

Recent Answers


David te Kloese answered on October 9, 2019 12:22 (last edited on October 9, 2019 12:24)

Undo checkout would basically delete any changes that might have been done in the mean time.. so I'd be careful with something like that.

Here is an article with some sample code to loop through all checked-out items and revert changes: https://devnet.kentico.com/articles/checking-in-all-objects

You could add additional logic to check if it's not updated in the past x-days or make it a scheduled task to run automatically every x-days.

0 votesVote for this answer Mark as a Correct answer

david ndlovu answered on October 9, 2019 12:34

Hi David

Thank you very much for responding quickly, one more question . Does this also work for workflows?

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on October 9, 2019 12:40

When using an Advanced Workflow it's a bit more tricky, as rollback could mean removing a page that has never published at all or perhaps is just in a review state.

Depending on how it's setup and what you would want to rollback you can update your task/code.

See some API examples on workflow and versioning at docs.kentico.com/.../page-workflow-and-versioning

0 votesVote for this answer Mark as a Correct answer

david ndlovu answered on October 9, 2019 12:46

Thank you very much. Have a nice day

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.