Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

CD GET does not return list block value in ContentArea inlineBlock

Found in

EPiServer.CMS.Core 12.12.1

Fixed in

EPiServer.CMS.Core 12.14.0

(Or a related package)

Created

Feb 20, 2023

Updated

Apr 18, 2023

Area

CMS Core

State

Closed, Fixed and tested


Description

Fixed an issue where the CD GET did not return a list block value in ContentArea inlineBlock.

Steps to reproduce:

1. Call Content Definition API to create a block type BlockWithListBlockAndInteger, properties BlockList and Interger (or any property type)

{
    "name": "BlockWithListBlockAndInteger",
    "baseType": "Block",
    "properties": [
        {
            "name": "BlockList",
            "dataType": "PropertyCollection",
            "itemType": "EditorialBlock",
            "branchSpecific": false,
            "editSettings": {
                "visibility": "default",
                "displayName": "BlockList",
                "groupName": "Information",
                "sortOrder": 0
            }
        },
        {
            "name": "PropInteger",
            "dataType": "PropertyNumber",
            "branchSpecific": false,
            "editSettings": {
                "visibility": "default",
                "displayName": "PropInteger",
                "groupName": "Information",
                "sortOrder": 0
            }
        }
    ]
}

 2. Call Content Management API to create a ProductPage content, ContentArea has inlineBlock is BlockWithListBlockAndInteger

{
    "language": {
        "name": "sv"
    },
    "name": "InlineBlock_Page",
    "contentType": [
        "Block",
        "ProductPage"
    ],
    "parentLink": {
        "id": {{testContainerPageId}}
    },
    "status": "Published",
    "UniqueSellingPoints": {
        "value": [
            "1"
        ]
    },
    "RelatedContentArea": {
        "value": [
            {
                "displayOption": "wide",
                "tag": null,
                "inlineBlock": {
                    "contentType": [
                        "Block",
                        "BlockWithListBlockAndInteger"
                    ],
                    "blockList": {
                        "value": [
                            {
                                "name": "BlockList",
                                "propertyDataType": "PropertyBlock",
                                "propertyItemType": "EditorialBlock",
                                "mainBody": {
                                    "value": "EditorialBlock mainbody",
                                    "propertyDataType": "PropertyXhtmlString"
                                }
                            }
                        ],
                        "propertyDataType": "PropertyCollection",
                        "propertyItemType": "PropertyBlock"
                    },
                    "propInteger": {
                        "value": 1,
                        "propertyDataType": "PropertyNumber"
                    }
                }
            }
        ],
        "propertyDataType": "PropertyContentArea"
    }
}

3. Call Content Management API GET to get content in step 2

  • Observed result: The inlineBlock is correct as input
"inlineBlock": {
                    "contentType": [
                        "Block",
                        "BlockWithListBlockAndInteger"
                    ],
                    "blockList": {
                        "value": [
                            {
                                "name": "BlockList",
                                "propertyDataType": "PropertyBlock",
                                "propertyItemType": "EditorialBlock",
                                "mainBody": {
                                    "value": "EditorialBlock mainbody",
                                    "propertyDataType": "PropertyXhtmlString"
                                }
                            }
                        ],
                        "propertyDataType": "PropertyCollection",
                        "propertyItemType": "PropertyBlock"
                    },
                    "propInteger": {
                        "value": 1,
                        "propertyDataType": "PropertyNumber"
                    }
                }

4. Call Content Definition API GET to get content in step 2

  • Expected result: InlineBlock is same as result in step 3
  • Actual result: InlineBlock has blockList value is []
"inlineBlock": {
                    "contentType": [
                        "Block",
                        "BlockWithListBlockAndInteger"
                    ],
                    "blockList": {
                        "value": [],
                        "propertyDataType": "PropertyCollection",
                        "propertyItemType": "PropertyBlock"
                    },
                    "propInteger": {
                        "value": 1,
                        "propertyDataType": "PropertyNumber"
                    }
                }