ContentArea contains an invisible, deleted block. How to clean up?

Vote:
 

I've had some issues with a block failing with a NullReferenceException for a while now. After a lot of debugging I was finally able to trace the reason to a deleted block that is still referenced in one of the ContentAreas. It's not visible from anywhere, including All Properties, but looking in the database I found it there among all the other valid contents of that particular ContentArea:

<div data-classid="..." data-contentgroup=""
    data-contentguid="X" data-contentname="[some name, valid]">{}</div>
<div data-classid="..." data-contentgroup=""
    data-contentguid="Y" data-contentname="[some name, seemingly valid]">{}</div>
<div data-classid="..." data-contentgroup=""
    data-contentguid="Z" data-contentname="[some name, valid]">{}</div>

(this is from the LongString column in tblContent for the ContentArea property on the parent block)

Looking up all the contentguids, I found everyone but "Y".

So my question is; how do I clean this up? Of course I could probably just edit this row in the database directly, and that's fine for dev, but for a production environment it involves a fair amount of red tape I'd prefer to avoid if possible.

And if anyone has any theories on how this could happen in the first place, I'd love to hear them.

#205356
Jul 08, 2019 16:46
Vote:
 

I suspect that if you make a change in that content area (e.g. change a display option or change the order of some items) then publish, it will overwrite the invalid data and resolve the issue.

To answer your other question, this will have most likely happened because someone added a block to the content area then deleted the block, ignoring the warning saying it was in use.

#205357
Jul 08, 2019 17:59
Vote:
 

Thanks, Paul! Changing the order did the trick, something I thought I had done, but probably forgot. I can't believe it was that easy :)

#205368
Jul 09, 2019 9:30
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.