Accidently deleted custom types and Slice content relationships are no longer linked

I accidentally deleted custom types that linked to a Slice content relationship, so I re-created custom types and re-linked them to a Slice, but in slice console.log type: 'broken_type',

This Slice is related to this post that I have been trying to solve for two days, so please help.

For some reason, it looks like the Custom Types data is still there but it doesn't link.

[next] {
[next]   variation: 'default',
[next]   version: 'initial',
[next]   items: [ { tab: [Object] }, { tab: [Object] }, { tab: [Object] } ],
[next]   primary: { show_intro: true, intro: [ [Object] ] },
[next]   id: 'tabs$ad31de2d-1208-4494-b839-ed578038f8b0',
[next]   slice_type: 'tabs',
[next]   slice_label: null
[next] }
[next]  ✓ Compiled in 851ms (3142 modules)
[next] {
[next]   tab: {
[next]     id: 'ZcEfGxEAAJlzoAwh',
[next]     type: 'broken_type',
[next]     tags: [],
[next]     lang: null,
[next]     slug: '-',
[next]     first_publication_date: null,
[next]     last_publication_date: null,
[next]     link_type: 'Document',
[next]     isBroken: true
[next]   }
[next] }
[next] {
[next]   tab: {
[next]     id: 'ZcFJGBEAADGKoFSf',
[next]     type: 'broken_type',
[next]     tags: [],
[next]     lang: null,
[next]     slug: '-',
[next]     first_publication_date: null,
[next]     last_publication_date: null,
[next]     link_type: 'Document',
[next]     isBroken: true
[next]   }
[next] }
[next] {
[next]   tab: {
[next]     id: 'ZcFKExEAABmLoFZ2',
[next]     type: 'broken_type',
[next]     tags: [],
[next]     lang: null,
[next]     slug: '-',
[next]     first_publication_date: null,
[next]     last_publication_date: null,
[next]     link_type: 'Document',
[next]     isBroken: true
[next]   }
[next] }

Your types are versioned with your version control. Can you revert back to before they were broken?

Thank you for helping me again!

Should I delete custom types that I re-created first and run git revert ?

I do recommend trying to revert so you can get back to your previous set up

Here is the last git log.

5ca2ae6 (HEAD -> main, origin/main, 5ca2ae62c, 5ca2ae) Resolve TypeScript errors on passing data from a server to a client

I have created more slices.

Should I run git revert 5ca2ae6 --no-edit

I wish I could tell you, I’m an expert reverting a get commit, I also wouldn’t want to take the responsibility of telling you which commit to revert to. However, if you think this commit is the one before the deletion, I’d go with it.

Forgive the Bad voice typing. I am cooking dinner for the kiddos right now.

The type still not linked. type: 'broken_type',

When you revert, did you relaunch slice machine? Did it say there were changes that needed to be pushed?

Yes, I pushed all the changes in the slice machine after reverting it.

Since I have that other repo I used to help earlier, tell me how you broke it so I can recreate that too, and then I'll see if I can fix it

I presume you deleted the Tab custom type?

If you delete the instance of the slice in your page, and then re-add your Tabs slice and add the content relationships, does that work? Boy they really yell at you when you try to delete a custom type.

Did you see something like this when you deleted it?
Screenshot 2024-02-08 193128

Screenshot 2024-02-08 193303

Screenshot 2024-02-08 193354

Yes, that was exactly how I did it.
I have a Slice called Test and I wanted to delete it while I was rushing to pick up my kids. It was a stupid mistake.

Ouch... yeah, so those Tab documents are toast. I just recreated the deletion. I then reverted my changes. I had to recreate the Tab documents and then re-link them in the slice.

1 Like

OMG! After 5 hours with so many tests, re-created, and reverted it screamed at my laptop, etc. I finally got it back on the browser.

I deleted custom types and all documents got deleted as well so all of these documents in a slice lost the data.

Solution:
I recreated documents, re-linked them in a slice editor, and yes reverted git and it worked.

Thank you so much for helping me , I really appreciate it!

2 Likes