Thru a series of unfortunate events (most likely missing a template in a package between servers/instances) I found myself having issues inserting links thru the General Link
field. Tracked it down to an item in the content tree that had an item with no defined Template
:
This makes it hard to edit, change template or even delete the item. I have tried a few different ways to resolve the issue including using Sitecore Powershell Extensions
which I have had good luck with corrupted items, but unfortunately this time it did not; Null Object Reference
while trying to execute a script that would just set it to a very basic template:
$badItem = Get-Item "master:/sitecore/content/Site/Home/JobTagDetails"
$baseTemplateItem= Get-Item "/sitecore/templates/System/Item"
Set-ItemTemplate -Item $badItem -Template $baseTemplateItem
Which I can only assume is because of the null
value on the item template value even within Sitecore Powershell Extensions
. Is there any other ways to delete a corrupted Item (particularly one that lacks a defined template)? I considered serializing the tree to server, grabbing the directory, omitting the corrupted and updating the tree from serialized values but that seems like (and maybe will as a last stitch effort) a very aggressive way to resolve the issue.
Set-ItemTemplate
with this issue github.com/SitecorePowerShell/Console/issues/1138.