Ghost label bug

Hi, I have two Prismic repos that I did not build, but inherited. One is treated as a dev instance and the other a prod instance. When looking at a Title field I notice it's highlighted as if there's a label applied to it. I know it's not possible to apply labels to Title fields, yet one of the repos returns with a label applied to it.

How come these Title fields still have a label associated with them? Was it possible to apply labels to any field before? More importantly, why does one repo still have a label on it? See below the result of a GraphQL query on both of the repos.

Dev Prismic repo

{
  "data": {
    "allStandard_pages": {
      "edges": [
        {
          "node": {
            "body": [
              {},
              {},
              {
                "primary": {
                  "table_title": [
                    {
                      "type": "heading3",
                      "text": "Small Exchange Clearing Members",
                      "spans": [
                        {
                          "start": 0,
                          "end": 31,
                          "type": "label",
                          "data": {
                            "label": "Box"
                          }
                        }
                      ]
                    }
                  ]
                }
              },
              {},
              {
                "primary": {
                  "table_title": [
                    {
                      "type": "heading3",
                      "text": "Small Exchange Corporate Members",
                      "spans": [
                        {
                          "start": 0,
                          "end": 32,
                          "type": "label",
                          "data": {
                            "label": "Box"
                          }
                        }
                      ]
                    }
                  ]
                }
              },
              {}
            ]
          }
        }
      ]
    }
  }
}

Prod Prismic repo

{
  "data": {
    "allStandard_pages": {
      "edges": [
        {
          "node": {
            "body": [
              {},
              {},
              {
                "primary": {
                  "table_title": [
                    {
                      "type": "heading3",
                      "text": "Small Exchange Clearing Members",
                      "spans": [
                        {
                          "start": 0,
                          "end": 31,
                          "type": "label",
                          "data": {
                            "label": "label"
                          }
                        }
                      ]
                    }
                  ]
                }
              },
              {},
              {
                "primary": {
                  "table_title": [
                    {
                      "type": "heading3",
                      "text": "Small Exchange Corporate Members",
                      "spans": [
                        {
                          "start": 0,
                          "end": 32,
                          "type": "label",
                          "data": {
                            "label": "label"
                          }
                        }
                      ]
                    }
                  ]
                }
              },
              {}
            ]
          }
        }
      ]
    }
  }
}

Hi @andrey.drozd,

On the contrary, you can indeed apply labels to Titles the same as Rich Text fields! You can follow our labels documentation, and the instructions are the same for Titles as they are for Rich Text. Please let me know if you have any questions.

Best,
Sam

I had forgotten to mention that the JSON config for this custom type field doesn't have any of the labels that are shown in the GraphQL response. See below.

"table_title": {
                "type": "StructuredText",
                "config": {
                  "single": "heading2, heading3, heading4, heading5, heading6",
                  "label": "Table Title"
                }
              },

Hey @andrey.drozd,

Ah, I see. It's possible that the field used to have a label, and it was removed. Removing the label from the Custom Type doesn't remove the label from the documents. The documents won't change until you edit them individually. This is to prevent a change to the Custom Type causing unwanted changes in your documents. Does that make sense?

Best,
Sam

Got it, that makes sense. I thought that's what happens but I wasn't sure. Thank you for the explanation!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.