Problem/Motivation
I tryed to Upgrade von Domain Theme Switch 2.1.1 and Domain 2.0.1.
After upgrading both modules I get an error when trying an database-update with the following error:
The website encountered an unexpected error. Try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "domain_config_ui.manager". Did you mean this: "locale.config_manager"? in Drupal\Component\DependencyInjection\Container->get() (line 159 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\domain_theme_switch\Form\DomainThemeSwitchConfigForm::create() (Line: 41)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)
And I am getting an white page, too.
The updatedb says:
hook_update_n (10001) failed. You have requested a non-existent service "domain_config_ui.manager
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork domain_theme_switch-3588538
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 #2
dbielke1986 commentedComment #5
mably commentedHi @dbielke1986,
Thanks for the detailed report. The fix is up as MR !16. Rather than just adding the missing dependency declaration, it removes the use of the
domain_config_ui.managerservice entirely sodomain_theme_switchworks on sites that do not havedomain_config_uienabled — your case — without forcing every site to install the UI submodule.The runtime mechanism that actually applies the per-domain theme override comes from
domain_config's taggedconfig.factory.overrideservice, which works whether or notdomain_config_uiis enabled. The form and the migration update hook now go throughdomain.config_factory_overridedirectly. The functional test was updated to dropdomain_config_uifrom$modules, so it now exercises exactly the path you hit.If you can apply this branch on your environment and confirm that the upgrade now completes
update_10001without the WSOD, I'll roll it into a3.0.1tag.MR: https://git.drupalcode.org/project/domain_theme_switch/-/merge_requests/16
Comment #6
dbielke1986 commentedHey @mably,
Wow, that was a great response and a ton of information.
Thank you so much for the detailed explanation and, above all, the fix.
I’ll try to test it on my end, but I can only do that when the server isn’t under much load.
I took a look at the MR, but I have a question about it:
Why has a dependency on “domain:domain_config” been added? I currently only have “domain:domain” active because that’s the only feature I need: registering multiple domains and switching themes depending on the domain.
Why do I now have to enable Domain Configuration when I don’t need that feature?
Comment #7
mably commenteddomain_configis required to manage configuration per domain.Here, it is used to override
system.themefor each domain.As soon as you confirm that the fix is working fine for you I'll merge it.
Comment #8
dbielke1986 commentedOk, so I will need to activate this sub-module before upgrading, too.
I already did the upgrade and installed the MR before running an updatedb.
...and what can I say?! It worked.
With the change from the MR, I was able to access all the configuration pages again, and my test of the website—admittedly quite brief and quick—was successful.
So, a huge thank you from me, and the green light for 3.0.1
Comment #10
mably commentedComment #12
dbielke1986 commented3.0.1 is working fine - I already updated our system.
Thank you so much!
Comment #13
mably commentedAdding a new guard to block update until domain_config has been enabled.