Problem/Motivation

Any field configured to use the domain_admin entity reference selection handler -- most notably the user field field_domain_admin shipped by this module -- reports "missing schema" rows on the Configuration Inspector page (admin/config/development/configuration/inspect/field.field.user.user.field_domain_admin/list):

field.field.user.user.field_domain_admin:settings.handler_settings.target_bundles: missing schema
field.field.user.user.field_domain_admin:settings.handler_settings.auto_create:    missing schema
field.field.user.user.field_domain_admin:settings.handler_settings.sort:            missing schema

Two underlying causes:

  1. No schema for the domain_admin selection handler. domain.schema.yml declares schemas for domain.record.*, views.filter.domain_filter, etc., but no entity_reference_selection.domain_admin. Drupal core falls back to entity_reference_selection.*, which only declares target_type, so the three handler_settings keys are unknown.
  2. The install yml uses the legacy structure. config/install/field.field.user.user.field_domain_admin.yml places target_bundles and sort directly under settings instead of nested under settings.handler_settings as required since Drupal 8.x. Core normalises this on import, but the install file should reflect the modern shape.

Steps to reproduce

  1. Install the Configuration Inspector module on a Drupal 11 site running Domain 3.x.
  2. Visit /admin/config/development/configuration/inspect/field.field.user.user.field_domain_admin/list.
  3. Observe three "missing schema" entries under display.default.display_options.fields.{field}.handler_settings.*.

Proposed resolution

Two minimal edits in the domain submodule:

1. Add a schema entry in domain/config/schema/domain.schema.yml. DomainAdminSelection extends DomainSelection (which extends DefaultSelection) and exposes the same handler settings, so the entry is a one-line type alias:

entity_reference_selection.domain_admin:
  type: entity_reference_selection.default
  label: 'Domain administrator selection handler settings'

2. Realign the install yml in domain/config/install/field.field.user.user.field_domain_admin.yml to the modern handler_settings nesting with an explicit boolean auto_create: false:

settings:
  handler: 'domain_admin'
  handler_settings:
    target_bundles: null
    auto_create: false
    sort:
      field: weight
      direction: ASC

The schema entry alone clears the three missing-schema reports for every site (existing and fresh). The install yml realignment ensures fresh installs match the schema exactly so the inspector is clean immediately, without relying on core's legacy normalisation.

Procedure for existing sites

Sites that have been running this module for a while may end up with auto_create: 0 stored as integer (a historical artefact of legacy form values). After updating to the version with this fix applied, those sites will see one residual schema error on field.field.user.user.field_domain_admin:

settings.handler_settings.auto_create: variable type is integer but applied schema class is BooleanData

To clear it:

  1. Visit /admin/config/people/accounts/fields/user.user.field_domain_admin (Manage fields, then Domain administrator, then Edit).
  2. Click Save settings without changing anything.

This triggers a FieldConfig save which merges the current handler defaults (auto_create is FALSE as boolean by default) and writes the field config back with the correct types. The Configuration Inspector page is clean immediately afterwards.

No update hook is included. The structural fix already covers fresh installs and the residual case clears on the first re-save.

Remaining tasks

  • Review the MR.
  • Ship in 3.x.

Test coverage

No new test added. The change is config schema only and is verified by Configuration Inspector returning no errors against field.field.user.user.field_domain_admin after applying the patch.

Issue fork domain-3589210

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Issue summary: View changes

mably’s picture

Issue summary: View changes
mably’s picture

Status: Active » Needs review

  • mably committed 8168987a on 3.x
    fix: #3589210 Add config schema for the domain_admin entity reference...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mably committed d48f5552 on 3.0.x
    fix: #3589210 Add config schema for the domain_admin entity reference...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.