Colleague Bill Cacy and I have been actively working with Sitecore recently on an issue that has been affecting one of our clients. When publishing a single item in the content tree with Publish related items checked, seemingly unrelated items, all the way up to the Home item, are being published as well.
The issue occurs when a user selects to Publish item from Sitecore and checks the Publish related items option. As Dmytro Shevchenko explains on Stack Exchange, the Publish related items option should trigger the following to be published with the current item:
- The item’s clones (by the
AddItemCloneReferencesprocessor);- The media used by the item (by processors
AddFileDropAreaMediaReferencesandAddItemLinkReferences);- All items the published item links to (by the
AddItemLinkReferencesprocessor).- The item’s aliases (by the
AddItemAliasReferencesprocessor).
All of these are expected. However, we have noticed that the ancestors of the item being published are also being published, even though they are in no way linked to publishing item, and meet none of the criteria above. Consider this simple Content Tree on a clean Sitecore install:
- sitecore
- content
- Home
- About
- Help
- FAQ
 
 
 
- Home
 
- content
All items created using the Sample Item template provided out of the box. No items have a data source set. Publishing any single item in the tree with Publish related items checked causes no issue–only that item is published.
However, pointing the Data Source of one of the items’ renderings to another item will trigger the Data Source‘s ancestors to be published as well:
- Update the Data Sourceof theSample Sublayoutrendering on theAboutitem to point to theAboutitem.
- Update the Titlefield on theHomeandAboutitems, and save.
- Publish just the Aboutitem, withPublish related itemschecked.
- Both HomeandAboutwill be published.
In this case Home should have not been published. About only links to itself through its Sample Sublayout Data Source.
Another example, but more far reaching:
- Update the Data Sourceof theSample Sublayoutrendering on theAboutitem to point to theFAQitem.
- Update the Titlefield on theHome,About,Help, andFAQitems, and save.
- Publish just the Aboutitem, withPublish related itemschecked.
- Home,- About,- Help, and- FAQwill be published.
In this case only About and FAQ should have been published–About was the publish target, and its Sample Sublayout Data Source links to FAQ. However, both of FAQ‘s ancestors, Help and Home, are published as well.
This issue does not seem to affect items that are in workflow. That is, an item that has a new version in Draft state, for example, will not be published through this issue.
Sitecore’s support team has been awesome and super responsive so far. They have narrowed the issue down to the Sitecore.Publishing.Pipelines.GetItemReferences.AddItemLinkReferences processor in the getItemReferences pipeline. I’ve confirmed that the issue affects Sitecore 8.0 initial release all the way up to Sitecore 8.2.
The issue has been raised as a bug with Sitecore and can be tracked with reference number 131687. Sitecore has released a patch on their Sitecore Support GitHub account, and you can download it here: https://github.com/SitecoreSupport/Sitecore.Support.131687/releases.


The patch is no longer publicly available, please request it via normal support procedure.