Today, one of my colleagues came across an Item in a Sitecore site that had the following message at the top:
If you publish now, the selected version will not be visible on the Web site because it has been replaced by a newer version.
Version 14 will be published instead.
We confirmed that the version that was displaying this message was, in fact, the highest numbered version, i.e., the latest version and had been pushed all the way through workflow. So workflow wasn’t the issue. We then displayed Standard Fields and looked at the Lifetime section – the Hide version checkbox field was checked. Unchecking this field made the error message go away. So I proceeded to try and figure out what was causing this field to get checked.
I decompiled the Sitecore.Kernel.dll and found that there is one property that maps to the Hide version field, Sitecore.Data.Items.ItemPublishing.HideVersion. I also found that only one method references this property, Sitecore.Shell.Applications.ContentManager.Dialogs.SetPublishing.SetPublishingForm.OnOK. This is the method that runs when you click the OK button in the Publishing Settings dialog (screenshot below).
What I believe happened is, a content author came to this screen and unchecked the checkbox in the Publishable column for the version in question which checked off the Hide version checkbox on the specific version of the Item which caused that message to display and prevented the version from being published. It’s a little confusing, but that’s what it does. This screen allows you to hide versions from being publishable by unchecking this checkbox which, consequently, checks off the Hide version checkbox on the actual Item version.
At this time, I’m unable to attribute this behavior to some automated reaction in Sitecore – all symptoms indicate that it was user error by the part of a content author.