Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong><em>TL;DR</em> Root content node had version in another language, removing that version, or only publishing in English language prevented publishing of items in draft mode</strong></p> <p>OK, so after trying @techphoria414's suggested code, it became clear that the context wasn't the issue. The publisher WAS adhering to workflow after all, but the problem has turned out to be the root content node having a version in another language (Japanese - don't ask me how this got there), but the descendant nodes having no versions in Japanese at all. In fact, our master database is only configured to have English as a language so it shouldn't even be possible for a user other than admin to add a version in another language.</p> <p>I have conducted some tests and found that the publisher ignores workflow for items that exist in another language. Consider the following scenario:</p> <p>1) You add a folder and any item underneath ("test workflow item") which has workflow. Don't commit the item, leaving it at version 1, in draft mode (i.e. shouldn't be publishable). The <strong>containing folder</strong> only has one version in one language (English):</p> <p><img src="https://i.stack.imgur.com/Iyvr7.jpg" alt="You add a folder and any item underneath which has workflow"> <img src="https://i.stack.imgur.com/1u2Ow.jpg" alt="Folder has english version only"></p> <p>2) You publish the folder with a deep publish to your web db (using the code in my question). This results in the following (folder added, but draft "test workflow item" not added). This is expected behaviour - yay!</p> <p><img src="https://i.stack.imgur.com/Mh4mB.jpg" alt="You publish the folder with a deep publish"></p> <p>3) Add a new version to the <strong>containing folder</strong> in a different language.</p> <p><img src="https://i.stack.imgur.com/XzJv7.jpg" alt="Add a new version to the containing folder in a different language"></p> <p>4) Check the workflow state of the child item now that Japanese is selected as the language. Notice, in the gutter it no longer says it is in draft mode, but there is no version at all in Japanese (as seen to the right).</p> <p><img src="https://i.stack.imgur.com/30Nki.jpg" alt="Check the workflow state of the child item now that Japanese is selected as the language"></p> <p>5) Publish the <strong>containing folder</strong> in all languages to the web db, exactly the same as before. Notice now that the "test workflow item" has been published, but with no versions at all. <strong>This is what happened with our publish, except from the very root content node which meant countless items got published that should not have been published</strong></p> <p><img src="https://i.stack.imgur.com/dkOLe.jpg" alt="Publish again using the exact same code"></p> <p>Now, why our root content node has a version in Japanese is a complete mystery, but at least we have figured out why our draft items got published so we can prevent it in the future. I suspect it has something to do with upgrading Sitecore as there are 2 versions in Japanese which roughly correspond to upgrade dates over the last 2 years.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload