@markiz,
You are correct this is not a long term solution but this is the current solution and it works well. This type of patch will be rolled into the next release.
But, this thread is about tracking down when and how this occurs. It would be helpful if you would elaborate on the steps you took that resulted in the issue appearing on your website.
The more information that can be gathered would be incredibly helpful.
Thanks!
I also reviewed the similar issue (which I tagged as related) but the solution appears outdated as the function was already declared.
shane birley → created an issue.
Unsure if bumping this one is the way to go but I have run into this issue during a Drupal 8 > 9.5.11 upgrade.
Running MariaDB 10.11.7.
Reviewing previous patches but they appear to already be in play.
In my case, the website was:
- Upgraded to the latest Drupal 8 (it was built clean on Drupal 8 with content imports from Drupal 7 via Feeds).
- Upgraded to the latest Drupal 9.
- Contrib modules were upgraded.
- Upgraded to Drupal 10.3.5.
- Contrib modules were upgraded where needed.
- Upgraded to Drupal 10.3.6.
- The issue started.
Through all of this, the Adminimal Theme was being used and was upgraded along with everything else. There was an introduction of a dependency of the Seven theme at some point and this might be where the issue started as Drupal 8 releases for Admiminal don't appear to have this dependency.
The error being produced has been consistent. There haven't been any other issues that appear to be related other than contrib modules with the usual updates. It felt like this one popped up at the 11th hour but I don't see anything in the upgrade process that would have caused it. Nothing obvious, anyway.
Cool. I also tested on PHP 8.3 and there is no change. To anyone reading this, the version of PHP 8.x is irrelevant.
@cilefen, I agree. I only mention it since there was talk earlier of a similar issue where PHP 8.3 appeared to break the sites. My comment is more of a reference.
I have tested this on PHP 8.1 and 8.2 and the error persists.
I was in process of upgrading a Drupal 8.x website to 10.3.x and everything was going well until yesterday when I upgraded to 10.3.6. I started getting the WSOD and this error popped up:
Uncaught PHP Exception TypeError: "Drupal\Core\Extension\ThemeHandler::addTheme(): Argument #1 ($theme) must be of type Drupal\Core\Extension\Extension, null given, called in /core/lib/Drupal/Core/Extension/ThemeHandler.php on line 74" at /core/lib/Drupal/Core/Extension/ThemeHandler.php line 84
I can confirm that patch #3 has resolved the issue.
Thanks @devad and @markdorison!
I can confirm that patch #15 has resolved the issue.
+1 Drupal 10 upgrades are starting in my world.
Agreed!
Shane Birley → created an issue.
I just tested the patch as well. I can confirm it works! Thanks, @Graber.
Shane Birley → created an issue.
And to clarify, this is on the latest version 2.0.6.
Just another note, Drupal believes the modules is indeed installed but the configuration pages are blank and return 404 errors.
Doing a fresh install of the module both via Composer and manual. I receive the same error. I uninstalled the module, installed a fresh copy of Drupal and installed this module by itself -- same error.
Uncaught PHP Exception RuntimeException: "Failed to start the session because headers have already been sent by "/home/www/modules/rest_api_authentication/rest_api_authentication.install" at line 1." at /home/www/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php line 152
RuntimeException: Failed to start the session because headers have already been sent by "/home/www/modules/rest_api_authentication/rest_api_authentication.install" at line 1. in /home/www/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php on line 152 #0 /home/www/core/lib/Drupal/Core/Session/SessionManager.php(162): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#1 /home/www/core/lib/Drupal/Core/Session/SessionManager.php(193): Drupal\Core\Session\SessionManager->startNow()
#2 /home/www/vendor/symfony/http-foundation/Session/Session.php(191): Drupal\Core\Session\SessionManager->save()
#3 /home/www/core/lib/Drupal/Core/StackMiddleware/Session.php(61): Symfony\Component\HttpFoundation\Session\Session->save()
#4 /home/www/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#5 /home/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#6 /home/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#7 /home/www/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /home/www/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /home/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /home/www/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /home/www/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#12 {main}