The Mysterious Page That Just Won't Publish, and How Standard Fields Can Save the Day

Today we had a report that a page was missing online. Expecting this was a simple fix I looked at publishing restrictions and published the item myself, but it didn't show up. Interesting issue, and the fix was sneaky but not overly difficult to find and rectify. Let's review the steps I took, and if you don't know what standard fields are, this will be something new for you.

This first thing I did was go into Content Editor, find the page (item) and go to Publish -> Change. Here I reviewed the restrictions on the item. As seen below, no settings were found, which means the item should be free to publish to all targets and any time.






After seeing all this and publishing the item myself I started second guessing what's going on. Maybe there's a bug with our custom URL resolution? I switched to the Web database and there I validated that the item is indeed missing, so it's back to publishing investigation.



After browsing through the standard fields, the problem became obvious. Someone had set this item to only publish to a target that no longer exists. Sitecore is being instructed to only publish here, and since “here” is a broken link, the valid targets won't be updated. Furthermore, the publishing restrictions dialogues above will not inform you a broken link exists in the “__Publishing groups” standard field.



Cleaning up the Site

Once the broken link was removed the page published fine and all was well again in this project, but I didn't stop there. I wanted to make sure no other items were affected, so I used the following script which will tell you other pages authored with the same mistake. I didn't want to automate the fix since any changed page could still be in the process of reviewing/authoring, etc. I just didn't want to assume they should be published immediately.

Get-ChildItem -Path master:/sitecore/content/ -Recurse |
  Where-Object { $_.Fields["__Publishing groups"]  -match '{your-guid-here}'} |
    ForEach-Object {
      Write-Host "Found page with bad target: " $_.Paths.Path
  }


How to See Standard Fields

In Content Editor, go to View, where you'll see a checkbox to enable Standard Fields.



Once enabled, you'll see a new set of data sections, with the Publishing section we needed.