+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Draft DynamicContent items showing up as live

Draft DynamicContent items showing up as live

2 posts, 0 answered
  1. David
    David avatar
    38 posts
    Registered:
    05 Apr 2012
    21 May 2014
    Link to this post

    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

  2. Nadezhda Petrova
    Nadezhda Petrova avatar
    20 posts
    Registered:
    28 Oct 2016
    26 May 2014
    Link to this post
    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
     
2 posts, 0 answered