Issue: Mislabeled fields due to parsing error of content type json #684

Closed
opened 2026-10-05 03:00:17 +02:00 by adam · 4 comments
Owner

Describe the bug

For some reason, FrontMatter is misinterpreting the contenttype configuration file for the field "thumbnail":. The thumbnail field is "heading field" or "primary field", which has several "subfields" or "secondary fields" on the next level below it. (The jargon is a little vague, admittedly) All of these subfields are strings, but FrontMatter is displaying all of them as datetime fields except the "authorURL" subfield, oddly that one is correct.

Below, I have attached the portion of the json file I am referring to. I have also uploaded a screenshot of what I am referring to, and the complete json file for that content type. Maybe I have misconfigured my json file.

{
            "title": "thumbnail",
            "name": "thumbnail",
            "type": "fields",
            "fields": [
                {
                    "title": "url",
                    "name": "url",
                    "type": "string"
                },
                {
                    "title": "author",
                    "name": "author",
                    "type": "string"
                },
                {
                    "title": "authorURL",
                    "name": "authorURL",
                    "type": "string"
                },
                {
                    "title": "origin",
                    "name": "origin",
                    "type": "string"
                },
                {
                    "title": "originURL",
                    "name": "originURL",
                    "type": "string"
                }
            ]
        }

To Reproduce
Steps to reproduce the behavior:

  1. Setup FrontMatter for a hugo site.
  2. Use the json file provided below as one of the content types
  3. Create content using that content type.

Expected behavior

All the subfields should be string fields, preferably single lined.

Screenshots

FrontMatter-bug

Device:

  • OS: Kali Linux
  • Front Matter CMS Version: Front Matter (v10.5.112333718-beta BETA)
  • Browser N/A, but FireFox

Additional context

This is the configuration file for that content type:

{
    "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json",
    "name": "legal",
    "pageBundle": false,
    "fields": [
        {
            "title": "title",
            "name": "title",
            "type": "string",
            "single": true
        },
        {
            "title": "description",
            "name": "description",
            "type": "string"
        },
        {
            "title": "date",
            "name": "date",
            "type": "datetime",
            "isPublishDate": true
        },
        {
            "title": "tags",
            "name": "tags",
            "type": "tags"
        },
        {
            "title": "Categories",
            "name": "categories",
            "type": "choice",
            "choices": [
                "Persons",
                "Evidence",
                "Legal"
            ]
        },
        {
            "title": "Type",
            "name": "type",
            "type": "choice",
            "choices": [
                "default",
                "docs",
                "minimal"
            ],
            "default": "docs"
        },
        {
            "title": "draft",
            "name": "draft",
            "type": "draft"
        },
        {
            "title": "thumbnail",
            "name": "thumbnail",
            "type": "fields",
            "fields": [
                {
                    "title": "url",
                    "name": "url",
                    "type": "string"
                },
                {
                    "title": "author",
                    "name": "author",
                    "type": "string"
                },
                {
                    "title": "authorURL",
                    "name": "authorURL",
                    "type": "string"
                },
                {
                    "title": "origin",
                    "name": "origin",
                    "type": "string"
                },
                {
                    "title": "originURL",
                    "name": "originURL",
                    "type": "string"
                }
            ]
        }
    ]
}
**Describe the bug** For some reason, FrontMatter is misinterpreting the contenttype configuration file for the field `"thumbnail":`. The thumbnail field is "heading field" or "primary field", which has several "subfields" or "secondary fields" on the next level below it. (The jargon is a little vague, admittedly) All of these subfields are strings, but FrontMatter is displaying all of them as datetime fields except the "authorURL" subfield, oddly that one is correct. Below, I have attached the portion of the json file I am referring to. I have also uploaded a screenshot of what I am referring to, and the complete json file for that content type. Maybe I have misconfigured my json file. ```json { "title": "thumbnail", "name": "thumbnail", "type": "fields", "fields": [ { "title": "url", "name": "url", "type": "string" }, { "title": "author", "name": "author", "type": "string" }, { "title": "authorURL", "name": "authorURL", "type": "string" }, { "title": "origin", "name": "origin", "type": "string" }, { "title": "originURL", "name": "originURL", "type": "string" } ] } ``` **To Reproduce** Steps to reproduce the behavior: 1. Setup FrontMatter for a hugo site. 2. Use the json file provided below as one of the content types 3. Create content using that content type. **Expected behavior** All the subfields should be string fields, preferably single lined. **Screenshots** ![FrontMatter-bug](https://github.com/user-attachments/assets/dd126c32-6510-4a61-80ef-0296b352fd4e) **Device:** - OS: Kali Linux - Front Matter CMS Version: Front Matter (v10.5.112333718-beta BETA) - Browser N/A, but FireFox **Additional context** This is the configuration file for that content type: ```json { "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json", "name": "legal", "pageBundle": false, "fields": [ { "title": "title", "name": "title", "type": "string", "single": true }, { "title": "description", "name": "description", "type": "string" }, { "title": "date", "name": "date", "type": "datetime", "isPublishDate": true }, { "title": "tags", "name": "tags", "type": "tags" }, { "title": "Categories", "name": "categories", "type": "choice", "choices": [ "Persons", "Evidence", "Legal" ] }, { "title": "Type", "name": "type", "type": "choice", "choices": [ "default", "docs", "minimal" ], "default": "docs" }, { "title": "draft", "name": "draft", "type": "draft" }, { "title": "thumbnail", "name": "thumbnail", "type": "fields", "fields": [ { "title": "url", "name": "url", "type": "string" }, { "title": "author", "name": "author", "type": "string" }, { "title": "authorURL", "name": "authorURL", "type": "string" }, { "title": "origin", "name": "origin", "type": "string" }, { "title": "originURL", "name": "originURL", "type": "string" } ] } ] } ``` <!-- github-sync-id:2591368721 -->
adam closed this issue 2026-10-05 03:00:17 +02:00
Author
Owner

Found it! Along with having issues regarding uniformity of labels across types, in another content type file, the subfields were assigned to datetime types. So, this other file must have been created before the one mentioned above.

Found it! Along with having issues regarding uniformity of labels across types, in another content type file, the subfields were assigned to datetime types. So, this other file must have been created before the one mentioned above. <!-- github-comment-id:2416391156 -->
Author
Owner

Hi @anoduck, I've checked your configuration, but I don't see anything wrong with it, and it outputs the correct fields in my test setup:

image

The only thing I see, is that your origin-url and author-url properties are not correctly mapped in the content type. The name originURL and authorURL need to be updated. Although, this should not cause it from rendering as datetime fields.

Hi @anoduck, I've checked your configuration, but I don't see anything wrong with it, and it outputs the correct fields in my test setup: <img width="344" alt="image" src="https://github.com/user-attachments/assets/8f351e55-f9e5-4d27-add6-ab2e49947558"> The only thing I see, is that your `origin-url` and `author-url` properties are not correctly mapped in the content type. The name `originURL` and `authorURL` need to be updated. Although, this should not cause it from rendering as `datetime` fields. <!-- github-comment-id:2416391655 -->
Author
Owner

Oh, thanks @anoduck for the update.

Oh, thanks @anoduck for the update. <!-- github-comment-id:2416392690 -->
Author
Owner

@estruyf I know it has to be frustrating for maintainers, which is why maintainers are the superheroes of the Open Source community.

I had returned to VSCode and by chance discovered a discrepancy in the labeling of a pair of fields. It was during the correction of these discrepancies, I discovered a contenttype which actually had the above-mentioned values defined as a datetime type. Although, this setting was not in the same contenttype referenced in the example above, I believe it established a precedence in frontMatter's database that lead to the creation of this issue.

Blessings.

@estruyf I know it has to be frustrating for maintainers, which is why maintainers are the superheroes of the Open Source community. I had returned to VSCode and by chance discovered a discrepancy in the labeling of a pair of fields. It was during the correction of these discrepancies, I discovered a contenttype which actually had the above-mentioned values defined as a datetime type. Although, this setting was not in the same contenttype referenced in the example above, I believe it established a precedence in frontMatter's database that lead to the creation of this issue. Blessings. <!-- github-comment-id:2418518387 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#684