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.

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

drupalgarm created an issue. See original summary.

mably made their first commit to this issue’s fork.

mably’s picture

Status: Active » Needs review

Hi @drupalgarm, can you give a try to this issue's MR please?

drupalgarm’s picture

Status: Needs review » Reviewed & tested by the community

Hey @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!!

  • mably committed 14ef5d9b on 3.x
    Issue #3552009 by drupalgarm, mably: DomainThemeSwitchConfigForm error...
mably’s picture

Status: Reviewed & tested by the community » Fixed

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

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

Maintainers, please credit people who helped resolve this issue.

mably’s picture

Released in 3.0.0-alpha3.

Status: Fixed » Closed (fixed)

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