Problem/Motivation
DomainSourceActionBase::buildConfigurationForm() renders the domain_id setting as a checkboxes element, but everything else expects one domain id: the action.configuration.domain_source_set_action schema types it as a string, DomainSourceSet::execute() uses it as an array key and as the field value, and calculateDependencies() concatenates it into a config name.
A checkboxes element always submits an array, so any configuration built through the form, for example by Views Bulk Operations, stores something like ['one_example_com' => 'one_example_com', 'example_com' => 0]. Running the action then fails: with Domain Access installed, isset($node_domains[$id]) throws a TypeError on the array offset, and without it the array is written into the single-value field_domain_source. The dependency calculation also raises an "Array to string conversion" warning and records a dependency on domain.record.Array.
The actions created automatically for each domain (domain_source_set_action.domain_id) are not affected, because they are saved with a string id and never go through the form.
Steps to reproduce
With Views Bulk Operations, add the "Set domain source" action to a content view, select a node, pick a domain in the action form and execute it.
Proposed resolution
Render domain_id as radios, which submit the single id the schema, execute() and calculateDependencies() already expect, and add a kernel test that submits the configuration form through the form builder and asserts the stored value is that one id.
Remaining tasks
Backport to 3.x, which carries the same form.
AI-Generated: Yes (Claude Code was used to find the defect, to draft this issue summary and to write the fix and its test on the merge request. I reviewed them before posting, and the test fails on 4.x without the fix.)
Issue fork domain-3627950
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
Comment #3
mably commentedComment #9
mably commented