Symptom
Saving the Domain Theme Switch configuration form on a site that does not have an admin theme set (or for a domain that has never had an admin theme override saved) emits a PHP warning:
Warning: Undefined array key "admin" in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->submitForm() (line 207 of …/DomainThemeSwitchConfigForm.php)
Cause
Line 207 of submitForm() reads $system_theme_config['admin']. The admin key on Drupal core's system.theme config is optional — it is only present when an admin theme is explicitly configured. On the no-admin-theme baseline the key is missing.
The warning is non-fatal: $original_admin_theme resolves to NULL, the $original_admin_theme !== $new_admin comparison evaluates to TRUE, the override save still proceeds. But the warning floods the log on every submit.
Fix
Defensive fallback on lines 206–207 — ?? '' to default a missing key to an empty string. Symmetrical handling for both default and admin, even though default is always set on system.theme, so the code does not encode any assumption that depends on Drupal core internal storage details.
Issue fork domain_theme_switch-3588930
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 #4
mably commented