Skip to content

TenantModelExtension fields not rendering in Admin UI #5087

@mjwlist

Description

@mjwlist

Version

6.1.0

Operating System

macOS Darwin 25.4.0

Browser

Chrome (latest)

What are the steps to reproduce this bug?

  1. Create a TenantModelExtension following the docs:
import { TenantModelExtension as ModelExtension } from "webiny/api/tenant-manager";

class TenantFieldsModelExtension implements ModelExtension.Interface {
    execute(extension: ModelExtension.Extension) {
        extension
            .fields(fields => ({
                domains: fields
                    .text()
                    .list()
                    .label("Domains")
                    .defaultValue([])
                    .renderer("textInputs", {
                        multiValue: { addValueButtonLabel: "Add Domain" }
                    })
            }))
            .layout([["domains"]]);
    }
}

export default ModelExtension.createImplementation({
    implementation: TenantFieldsModelExtension,
    dependencies: []
});
  1. Register in webiny.config.tsx:
<Api.Extension src={"/extensions/tenantFields/TenantFieldsModelExtension.ts"} />
  1. Deploy API and Admin: yarn webiny deploy api && yarn webiny deploy admin
  2. Navigate to Tenant Manager, click any tenant or "New Tenant"

Also reproduced using the official scaffold: yarn webiny extension tenant-fields — same result.

What is the expected behavior?

Extension fields (e.g. "Domains") should appear in the tenant form below Name and Description, as stated in the docs: "Once added, they automatically appear in the Tenant form in the Admin UI."

What do you see instead?

Only Name and Description are visible. The extension fields do not render.

Additional information

The API side works correctly. Querying the model via the CMS manage API confirms the extensions object field contains the child domains field with correct renderer and layout:

{
  "fieldId": "extensions",
  "type": "object",
  "renderer": { "name": "passthrough" },
  "settings": {
    "fields": [{ "fieldId": "domains", "type": "text", "renderer": { "name": "text-inputs" } }],
    "layout": [["domains"]]
  }
}

The Admin receives this correct model definition (confirmed by intercepting the CmsGetContentModel network response). The extensions field renders as a <hcms-model-field> custom element in the DOM but with empty innerHTML and 0 height:

<hcms-model-field data-field-id="name" data-type="text">...(content)...</hcms-model-field>
<hcms-model-field data-field-id="description" data-type="long-text">...(content)...</hcms-model-field>
<hcms-model-field data-field-id="extensions" data-type="object"></hcms-model-field>

React fiber inspection shows the RenderField component for the extensions field has hasChildren: false — it returns null. The passthrough renderer plugin is registered (via allPlugins.js) and its render() function returns a <Fields> component, but this component produces no output. No errors are logged by the ErrorBoundary.

Possible solution

The passthrough renderer calls getBind() then passes the resulting Bind component to the child Fields. The issue likely originates in the Bind context not being correctly set up for nested fields within the tenant model's extensions object — the child Fields component may be silently failing to resolve form bindings or field renderers for the nested fields.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions