Issue: Media used as fieldGroup inside a fieldGroup not working #463

Closed
opened 2026-10-05 02:48:36 +02:00 by adam · 1 comment
Owner

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
Creating a fieldGroup with a nested fieldGroup of type media/image:

{
      "id": "selectedWorks",
      "labelField": "workTitle",
      "fields": [
        {
          "title": "Work Title",
          "name": "workTitle",
          "type": "string",
          "single": true
        },
        {
          "title": "Selected Media",
          "name": "selectedMedia",
          "type": "block",
          "fieldGroup": [
            "mediaSource"
          ]
        }
      ]
    },
    {
      "id": "mediaSource",
      "labelField": "sourceName",
      "fields": [
        {
          "title": "Source Name",
          "name": "sourceName",
          "type": "string",
          "single": false
        },
        {
          "title": "Source Path",
          "name": "sourcePath",
          "type": "image",
          "isPreviewImage": false,
          "multiple": false
        }
      ]
    }

Than assign it to my contentType:

 {
      "name": "dummypage",
      "pageBundle": true,
      "previewPath": null,
      "fields": [
        {
          "title": "Title",
          "name": "title",
          "type": "string"
        },
        {
          "title": "Works Media Selection",
          "name": "worksMediaSelection",
          "type": "block",
          "fieldGroup": [
            "selectedWorks"
          ]
        },
        {
          "title": "type",
          "name": "type",
          "type": "string"
        } 
      ]
    },

Expected behavior
Creating a list of images inside my selected Works Album and list all the picture below.

Screenshots
Resulting in just returning the Source Name.

---
title: dummy new one
worksMediaSelection:
  - workTitle: work
    selectedMedia:
      - sourceName: source
        fieldGroup: mediaSource
    fieldGroup: selectedWorks
type: dummypage
---

Desktop (please complete the following information):

  • OS: OSX 13.2
  • Browser Chrome, Safar...
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

**Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: Creating a fieldGroup with a nested fieldGroup of type media/image: ``` { "id": "selectedWorks", "labelField": "workTitle", "fields": [ { "title": "Work Title", "name": "workTitle", "type": "string", "single": true }, { "title": "Selected Media", "name": "selectedMedia", "type": "block", "fieldGroup": [ "mediaSource" ] } ] }, { "id": "mediaSource", "labelField": "sourceName", "fields": [ { "title": "Source Name", "name": "sourceName", "type": "string", "single": false }, { "title": "Source Path", "name": "sourcePath", "type": "image", "isPreviewImage": false, "multiple": false } ] } ``` Than assign it to my contentType: ``` { "name": "dummypage", "pageBundle": true, "previewPath": null, "fields": [ { "title": "Title", "name": "title", "type": "string" }, { "title": "Works Media Selection", "name": "worksMediaSelection", "type": "block", "fieldGroup": [ "selectedWorks" ] }, { "title": "type", "name": "type", "type": "string" } ] }, ``` **Expected behavior** Creating a list of images inside my selected Works Album and list all the picture below. **Screenshots** Resulting in just returning the Source Name. ``` --- title: dummy new one worksMediaSelection: - workTitle: work selectedMedia: - sourceName: source fieldGroup: mediaSource fieldGroup: selectedWorks type: dummypage --- ``` **Desktop (please complete the following information):** - OS: OSX 13.2 - Browser Chrome, Safar... - Version [e.g. 22] **Additional context** Add any other context about the problem here. <!-- github-sync-id:1762219197 -->
adam closed this issue 2026-10-05 02:48:36 +02:00
Author
Owner

@anthonykasabian, thanks for opening this issue; it was indeed a bug in the image field and mapping to the sub-block of its contents.

I have investigated it and came up with a fix. Feel free to give it a try in the latest beta version.

@anthonykasabian, thanks for opening this issue; it was indeed a bug in the image field and mapping to the sub-block of its contents. I have investigated it and came up with a fix. Feel free to give it a try in the latest beta version. <!-- github-comment-id:1598808558 -->
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#463