Draft DynamicContent items showing up as live

Posted by Community Admin on 04-Aug-2018 13:37

Draft DynamicContent items showing up as live

All Replies

Posted by Community Admin on 21-May-2014 00:00

Hi

 We have upgraded a site from Sitefinity 6 to 7 and have had an odd issue show up.

Steps to reproduce:
Create a page that pulls out DynamicContent items using the following code

Type typeOfItem = TypeResolutionService.ResolveType(YOUR_CUSTOM_MODULE_TYPE);
var manager = DynamicModuleManager.GetManager();
IQueryable<DynamicContent> items =  manager.GetDataItems(typeOfItem).Where(x => x.Status == ContentLifecycleStatus.Live && x.Visible);

Create a custom content item and save it as a draft. It will not show in items when queried. 

Publish this custom content item. It will show in items when queried.

Save this custom content item as a draft. The item will still show in items. The item will show in the Sitefinity backend as draft.

Anyone have any ideas what could be happening?

Thanks,
David

Posted by Community Admin on 26-May-2014 00:00

Hello David,

This is an expected behavior. Please read the following article: Content Lifecycle.

  • 'Create a custom content item and save it as a draft. It will not show in items when queried.'
    When you save the item as draft a Master version of the item is created. No Live version is created.
  • 'Publish this custom content item. It will show in items when queried.'
    When you publish the item the Master version is updated and a Live version is created for this item.
  • 'Save this custom content item as a draft. The item will still show in items. The item will show in the Sitefinity backend as draft.'
    When you save again the item as a draft the Master version is updated. The Live version is not updated but it still exists. Note that the item's status in the Sitefinity backend is Draft (newer than published) not just Draft. This means that the item still has a Live version but the Live version is not updated with the last changes.

Regards,
Nadezhda Petrova
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed