Skip to content

Issue: multiple dataFile types in contentTypes returns null label for some data #577

Closed

Description

@mayumih387

Hi! I'm not sure it's really a bug, but I can't reach out for solution.

With the contentTypes fields containing multipule dataFile type, no labels appear for some of data, not appropriate dropdown list either.

sidebar

sidebar

markdown file frontmatter

---
title: Ad est et ullam sequi aut optio rerum.
categories:
  - culpa
tags:
  - sequi
---

frontmatter.json

"frontMatter.data.files": [
    {
      "id": "categories",
      "title": "Categories",
      "file": "[[workspace]]/data/category.json",
      "fileType": "json",
      "labelField": "name",
      "schema": {
        "title": "Category",
        "type": "object",
        "required": ["slug", "name"],
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          }
        }
      }
    },
    {
      "id": "tags",
      "title": "Tags",
      "file": "[[workspace]]/data/tag.json",
      "fileType": "json",
      "labelField": "name",
      "schema": {
        "title": "Tag",
        "type": "object",
        "required": ["slug", "name"],
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          }
        }
      }
    }
  ],
"frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "previewPath": null,
      "fields": [
        {
          "title": "Title",
          "name": "title",
          "type": "string"
        },
        {
          "title": "Categories",
          "name": "categories",
          "type": "dataFile",
          "dataFileId": "categories",
          "dataFileKey": "slug",
          "dataFileValue": "name",
          "multiple": true
        },
        {
          "title": "Tags",
          "name": "tags",
          "type": "dataFile",
          "dataFileId": "tags",
          "dataFileKey": "slug",
          "dataFileValue": "name",
          "multiple": true
        }
      ]
    }
  ]

/data/category.json

[
  {
    "name": "Culpa",
    "slug": "culpa"
  },
  {
    "name": "Ab",
    "slug": "ab"
  },
  {
    "name": "Cupiditate",
    "slug": "cupiditate"
  }
]

/data/tag.json

[
  {
    "name": "Dicta",
    "slug": "dicta"
  },
  {
    "name": "Et",
    "slug": "et"
  },
  {
    "name": "Sequi",
    "slug": "sequi"
  }
]

Desktop:
OS: Windows 11
Editor: VS Code 1.77.3
Front Matter 8.4.0

The data view on the dashboard works fine.

Thanks in advance for any responses!

Activity

  1. estruyf commented on Apr 26, 2023

    @estruyf
    Owner

    Thank you @mayumih387 for opening this issue! Will check what is going wrong.

  2. added a commit that references this issue on Apr 26, 2023
  3. estruyf commented on Apr 26, 2023

    @estruyf
    Owner

    Thanks for providing the sample configuration; this helped a lot. I found the issue and also fixed it. You can test it out in the latest BETA version.

  4. mayumih387 commented on Apr 26, 2023

    @mayumih387
    ContributorAuthor

    Thank you for your quick response and the bug fix!

    I've checked the BETA v8.5.4806699 and it worked as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions