Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mayumih387 opened this issue Apr 26, 2023 · 3 comments
Labels
Projects

Comments

@mayumih387
Copy link
Contributor

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!

@mayumih387 mayumih387 added the bug Something isn't working label Apr 26, 2023
@estruyf estruyf added this to To do in 9.0.0 via automation Apr 26, 2023
@estruyf
Copy link
Owner

estruyf commented Apr 26, 2023

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

@estruyf estruyf moved this from To do to In progress in 9.0.0 Apr 26, 2023
estruyf added a commit that referenced this issue Apr 26, 2023
@estruyf
Copy link
Owner

estruyf commented Apr 26, 2023

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.

@mayumih387
Copy link
Contributor Author

Thank you for your quick response and the bug fix!

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

9.0.0 automation moved this from In progress to Done Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
9.0.0
Done
Development

No branches or pull requests

2 participants