I am trying to create a page programmatically from one version to another, in my case from UK language to the US. For some reason since the last couple of days now the new pages are created as Draft and not Published version.
My code for Save is
newLanguageBranch.Title = "US Title";
Can someone help me what could be the reason for this behaviour, the above code was working so far.
Have you upgraded version of Episerver recently? Also if this is accesed in the UI are you using a project?
No, we didn't do any upgrade recently, the code above was in production and working for last 2 months, all of sudden now it started creating pages in "Checkout" status and shows up as "Draft" in CMS UI.
I am not familiar with the Episerver project concept, but I don't think we have anything link project in CMS.
I feel like as if pages are getting created but instead of Publish they are marked as Checkout, do you think I need to call something extra after SAVE to make the newly created page Publish?
I would suggest you to contact developer support service. In this case looking at your code and database would be much easier to spot (then fix) the problem
Thanks for the suggestion, will do now.
I had been a bit bold and tried to get bottom of this issue on my own, I have some new findings to share.
I have 2 separate Web apps, one which has CMS running and another one that is API. When user create a page in one language an API call is triggered that creates the same page in 2 other languages automatically.
Seems like after it has done that in API app the CMS has a cache that thinks that it's not published and thus throws an error.
If I restart CMS app then instead of Draft it shows it as Published and everything works.
So now I am at a stage where I need a way I can clear the cache of a specific page in CMS app. Does anyone have any advice on how I can clear cache?
CatalogCache.Clear(); - DOESNT SEEMS TO WORK.
are webapps on the same server?
For others who might stumble upon here for the answer, in my case after clearing cache on my CMS app upon executing API fixed it.
it might have performance consequences..