Search code examples
sitecoresitecore8

In Sitecore, why does lifetime functionality work in preview mode but not in normal mode?


The question is about the Lifetime section of Sitecore Standard Template

My case:

I have 2 versions of an item. In version 2, I set the lifetime from: 10:30 am and to: 10:45 am.

I go in sc_mode=preview and see version 2 being used, which is correct. Now I set the time @ 11:00 am and version 1 is being used instead. This is working as intended.

Now I'm in sc_mode=normal. It is 10:40 am and version 2 is being used. I wait until 10:46 am, and version 2 is still being used. It has not switched to version 1. I've even tried to check the "hide version" checkbox on version 2, and it still shows that version.

FYI, I'm using the master database and cacheHtml="false" in the SiteDefinitions.config

How come? Is it only possible to test lifetime in preview mode?

Thanks in advance


Solution

  • This is possibly a bug, but may be due to the fact that typically sites point at a published database with only one version so showing 'latest published version' is usually correct.

    To have things work in 'normal' mode for most sites (which are not pointed at master) you would need a publish action to occur in order to update the valid version in the target database.