Page going to Draft instead of Published

Vote:
 

Hi All,

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 

var newLanguageBranchPage = DataFactory.Instance.CreateLanguageBranch(pageLink, new LanguageSelector(language)) as ArticlePage;

newLanguageBranch.Title = "US Title";

DataFactory.Instance.Save(newLanguageBranch, EPiServer.DataAccess.SaveAction.Publish, AccessLevel.NoAccess);

Can someone help me what could be the reason for this behaviour, the above code was working so far.

Thanks,

Anurag

#196371
Aug 28, 2018 13:32
Vote:
 

Have you upgraded version of Episerver recently? Also if this is accesed in the UI are you using a project?

#196408
Aug 29, 2018 20:25
Vote:
 

Hi,

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?

Thanks,

Anurag

#196556
Sep 04, 2018 11:32
Vote:
 

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

#196565
Sep 04, 2018 14:25
Vote:
 

Thanks for the suggestion, will do now.

-Anurag

#196570
Sep 04, 2018 16:01
Vote:
 

Hi,

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.

Thanks,

Anurag

#197463
Oct 03, 2018 12:31
Vote:
 

are webapps on the same server?

#197487
Oct 04, 2018 5:54
Vote:
 

Hi All,

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.

"CacheManager.Clear();"

Thanks,

Anurag

#197494
Oct 04, 2018 11:23
Vote:
 

it might have performance consequences..

#197495
Oct 04, 2018 11:38
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.