Breadcrumb "No" override doesn't work when global value is "Yes"

Created on 2 February 2023, almost 2 years ago

Problem/Motivation

Breadcrumb Schema on my homepage (which is a node) has bad values. The item prop is the "node/nid" path instead of "/" and the name prop is blank causing issues with Google Search Console. Example below:

{
            "@type": "WebPage",
            "breadcrumb": {
                "@type": "BreadcrumbList",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "",
                        "item": "https://example.ddev.site/node/200001"
                    }
                ]
            },
            "description": "Hide this"
},

So I've opted to expose the Breadcrumb Schema fields on my node type's edit form and set the homepage node to breadcrumb = "No" as I'm not 100% sure if having Breadcrumb Schema on the homepage is even necessary.

Steps to reproduce

1. WebPage Schema set up in global with the value defaulted to "Yes".
2. Go to node edit form with WebPage Schema exposed on it.
3. Set Breadcrumb from the default "Yes" to the override "No".
4. Save the node.
5. Notice that the value is not overridden.

Proposed resolution

I believe the issue is that metatag will fallback on values when the form value is empty. If "Yes" is set on global, setting "No" on the form with value "" will default back to "Yes".

<option value="">No</option>
<option value="Yes">Yes</option>

Perhaps this value should literally be "No" instead of ""?

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jklmnop

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024