Pivot creates empty json when using one value in a multi value field

Created on 19 July 2021, over 3 years ago
Updated 20 June 2023, over 1 year ago

Problem/Motivation

I have a content type with a multi value text field. I'm using a custom module to create a custom schema.org profile. Here I add the multiple = TRUE to allow the pivot option. When adding multiple values to the field the json is created correctly. So far this works.

{
    "@context": "https://schema.org",
    "@graph": [
        {
            "type": "Course",
            "name": "INTERdisciPLAYnarity",
            ....
            "creator": [
                {
                    "@type": "Person",
                    "name": "Prof. Dr. Sandra Aßmann"
                },
                {
                    "@type": "Person",
                    "name": "Prof. Dr. Christian Bunnenberg"
                }
            ]
        }
    ]
}

However, when adding one value to the field it shows only a empty array:

{
    "@context": "https://schema.org",
    "@graph": [
        {
            "type": "Course",
            "name": "INTERdisciPLAYnarity",
            ....
            "creator": []
        }
    ]
}

What have I missed here?

Steps to reproduce

1. Create a content type with a multi value text field
2. Add schema.org metatag with a Person property.
3. Enable Pivot
4. Add the token for your multi value field
5. Add one/multiple values to the content type
6. See results.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Existing structures

Created by

πŸ‡©πŸ‡ͺGermany Saif Al-Dilaimi

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024