3

JSS Layout Service default resolver resolves reference fields with full referenced item context, but other reference fields leaves with the ID of the referenced item.

For example there is an item, that has two fields of the same type that references other item by ID (multilist, droplink...). If this item is used by itself in the datasource and has no child items, then json rendering is processed correctly and Layout Service api returns this item with the fields, where referenced items are replaced with the context of those items. However if those fields reference similar items with similar structure of reference fields, that also references other items even deeper in the tree, then some fields are resolved by the referenced item context, but some left as IDs of the referenced item.

Item template: enter image description here

Item structure, where "New Test 1" item will be a datasource for json rendering and all child items reference their child items: enter image description here

Response from Layout Service API:

 {
        "uid": "1daec8dc-3068-48bc-a73a-1411d464fb5d",
        "componentName": "Test Component",
        "dataSource": "{20A06569-2FDB-4130-B9E7-4B6861682FAB}",
        "params": {
          
        },
        "fields": {
          "list1": [
            {
              "id": "7e47ccc1-ddf9-4967-ab80-a075dc53eb96",
              "fields": {
                "list1": [
                  {
                    "id": "e45adddc-75d5-43b6-aba6-d91d156f32a9",
                    "fields": {
                      "list1": [
                        
                      ],
                      "list2": [
                        
                      ]
                    }
                  }
                ],
                "list2": [
                  {
                    "id": "e45adddc-75d5-43b6-aba6-d91d156f32a9",
                    "fields": {
                      "list1": [
                        
                      ],
                      "list2": [
                        
                      ]
                    }
                  }
                ]
              }
            }
          ],
          "list2": "{7E47CCC1-DDF9-4967-AB80-A075DC53EB96}"
        }
      }

I would have expected field ""list2": "{7E47CCC1-DDF9-4967-AB80-A075DC53EB96}"" to be resolved the same as it is for list1.

Are there any configuration parameters for the rendering, that dictates how such fields should be resolved?

2
  • Hey @int.sli and welcome to Sitecore Comminity! If you create "New Test 2B" item on the same level as "New Test 2" and assign this one to list2 field? what will be value there then? Apr 14, 2021 at 10:40
  • Hi @PeterProcházka! Same result, but now it just shows the new ID of the "New Test 2B".
    – int.sli
    Apr 14, 2021 at 10:45

1 Answer 1

3

This looks similar to the issue we had in our solution which was identified as a bug in Layout Service and fixed for us by Sitecore Support in both 9.3 and 10.0.

You can check it with Sitecore Support with reference number: 442855 (CS0196105) Issue.

Description: LayoutService renders item fields without Values after reaching max depth for all the subsequent items\fields.

Reference: https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB1000593

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.