BUG - Slice Labels are being deleted

When creating a custom type, if I add labels to my custom slice, they are being deleted and disappearing.

They still appear in the API response sent back. However I have to keep adding them back in the Custom Type builder tool and they do not appear in the UI.

Hello @it13, welcome to the community.

Can you please send me the URL of your repository and, if possible, a screen recording of the steps you follow to encounter the error?

The threads close after a period of inactivity. Feel free to flag it if you need to continue the conversation.

https://oneplanetcrowd.prismic.io/

its hard to re-produce the error, but I will try and record it next time it happens

thanks

Hey @it13.

We need to know the workflow that you followed until you found the error to reproduce the case. So we can detect what causes it. Thanks.

The workflow is:

create custom type > add my custom label(s)

then when I go into Documents I can add my custom type and initially I see the new labels.

However when I later come back to the custom type the labels have disappeared. They still exist in the API call however, so it looks like it is just the UI that is missing them.

thanks

Hey there.

The team just informed me that this is a known bug that's currently being tracked in our backlog. But here's a workaround in the meantime:

  • Create the Slice on a separate "Slice Making" Custom Type or Repository
  • Copy Paste its JSON definition directly in the JSON editor of the Custom Type you want to add it to

Another option would be to replace your Slice Labels with a drop-down select field directly in the Slice. That will be a more stable option. I realize that this induces a lot of work on your side, so you'll are the best to judge which approach would work the best for you

We hope one of these workarounds will work for your team

This thread is being monitored as an open ticket in the internal Prismic issue tracker. The Prismic support team will update this post as we get more information from our dev team. If you have a similar use-case, you can ‘Flag’ this topic to reopen and add it here.

We are using this feature extensively on a new project for a client. Was not aware that it was buggy until the labels started disappearing.

Disappearing data seems like a critical issue -- is there any ETA on when this bug will be fixed?

Hi Arpan,

I understand that this is frustrating, although this is not something that is likely to be fixed, it's more likely to be deprecated as it has been replaced by the Slice Variations feature using Slice Machine.

When you say "Disappearing data seems like a critical issue", the data doesn't actually disappear until the documents using the Slice have been republished, so if you re-add the label in the Custom Type the data will come back.

Let me know if you have any further questions.

But slice variations aren't available using the regular API, right? It's only available if you are using slice machine with React. So any other framework isn't supported for this.

Or is there a way to use variations over an API with a static site generator like 11ty etc?

The problem with saying that it's simple enough for me or my team to do it. But once we hand this over to the client, they are not going to be able to use the CMS in the way we designed it to work for them. Meaning this will get flagged as a bug and we will be asked to fix it.

The whole reason we are using Prismic is so that a non-technical person will be able to create and manage the content. If this feature is deprecated, it would be good to know -- as we had no idea that was the case.

For now we'll figure out a work around.

In the meantime, is there any plan to support variations over the API or will this only be supported if we use specific libraries?

That's correct it's only available for react and vue users in terms of templating right now, the actual Slice (model) could still be built locally and sent to the Prismic repo with Slice Machine, this part is not technology-specific, it just wouldn't generate the code for you.

The Slice Labels feature isn't deprecated, if it was to be deprecated we would give everyone plenty of warning, the issue could be resolved when the team begins its overhaul on the editor. I don't have any confirmation on either of those things.

Issue:
The Slice Labels only disappear when a Custom Type is edited using the visual editor, this is because the Slice Labels can only be edited with the JSON editor. For the moment you'll need to remember to check Slice Labels after editing a Custom Type (I know this is frustrating). So when you hand the content over to the user they shouldn't need to make any changes in the Custom Types becuase it will need to be reflected in the code, so they won't lose their Slice Labels.

Solution:
The most reliable otpion is to use a Select Field as the first field in your Slice instead of Slice Labels. Your user can select what option they want using this field and the Select Field will never disappear as it is built using the Visual Builder. In your code you will use it the exact same way you use Slice Labels.

Thanks.

Yeah, I think that's what I'm going to do - we'll replace all the labels across the site with the select field and update the code to support that.

Thanks for your help.

1 Like

I'll also spend some time exploring slice machine and see if we can integrate it into our process. Thanks.

1 Like

Great, let me know how it goes.