Problem/Motivation
1. After activating the module, there are several error messages on the configure page:
Error message
Warning: Trying to access array offset on false in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->buildForm() (line 146 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
Error message
Warning: Trying to access array offset on false in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->buildForm() (line 147 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
Error message
Warning: Undefined array key "admin" in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->buildForm() (line 147 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
Error message
Warning: Trying to access array offset on false in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->buildForm() (line 146 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
Error message
Warning: Trying to access array offset on false in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->buildForm() (line 147 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
2. Additionally after enabling the theme override, there are other errmor messages:
Error message
Warning: Trying to access array offset on false in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->submitForm() (line 235 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
Error message
Warning: Trying to access array offset on false in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->submitForm() (line 236 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
Error message
Deprecated function: Automatic conversion of false to array is deprecated in Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm->submitForm() (line 247 of modules/contrib/domain_theme_switch/src/Form/DomainThemeSwitchConfigForm.php).
Steps to reproduce
1. Install the module composer require 'drupal/domain_theme_switch:^3.0@alpha'
2. Active it
3. Go to the "Configure" page while having active domain records
---
3a. Enable a theme override and more errors will appear.
Comments
Comment #4
mably commentedHi @drupalgarm, can you give a try to this issue's MR please?
Comment #5
drupalgarm commentedHey @mably,
I had a look for your changes which catched null values and tried the fork locally.
No error messages and the domain owner can chose a default domain theme on its own by the permission "Administer themes".
The selected theme will be also displayed in the config section by domain. in my case my default domain has the olivero and the claro theme for the other domain.
It works, thanks a lot!!
Comment #7
mably commentedComment #9
mably commentedReleased in 3.0.0-alpha3.