Problem/Motivation
When accessing the link at .../admin/appearance/settings on a Drupal 11 system, I'm getting this error:
InvalidArgumentException: Class "solo_form_system_theme_settings_alter" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 32 of core\lib\Drupal\Core\DependencyInjection\ClassResolver.php).
Drupal\Core\Utility\CallableResolver->getCallableFromDefinition('solo_form_system_theme_settings_alter') (Line: 592)
Drupal\Core\Theme\ThemeManager->getImplementationsForTheme('solo', 'form_system_theme_settings_alter') (Line: 556)
Drupal\Core\Theme\ThemeManager->alterForTheme(Object, 'form', Array, Object, 'system_theme_settings') (Line: 620)
Drupal\Core\Theme\ThemeManager->alter(Array, Array, Object, 'system_theme_settings') (Line: 893)
Drupal\Core\Form\FormBuilder->prepareForm('system_theme_settings', Array, Object) (Line: 304)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 634)
Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()
Fiber->start() (Line: 635)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 745)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I do not get this error on a Drupal 10 system.
Comments
Comment #2
ericvlThe core version that works is 10.6.5
The core version that gives the error is 11.3.5
Comment #3
flashwebcenterThanks for reporting this.
I cannot reproduce this locally or on the demo site, so at this point I cannot confirm whether this is a Solo-specific bug or something triggered by the site’s Drupal 11 environment.
Drupal 11 still supports procedural theme settings alters such as hook_form_system_theme_settings_alter(), so this hook is still valid.
The error indicates that Drupal is trying to invoke
solo_form_system_theme_settings_alter(), but that callable is not available at runtime on that site. In practice, that can happen for a few different reasons:Please try clearing caches first, then check
../admin/reports/statusfor any related PHP or Drupal errors.Best wishes,
Alaa
Comment #4
ericvlHello Alaa,
Thank you for your quick response - as always.
Clearing the cache didn't help to solve the problem. Even when I cleared all caches from within phpMyAdmin. I did a few other tests too to narrow the problem.
First, I've selected the Olivero theme as standard and admin theme, cleared all caches and had the same problem but now for the olivero_form_system_theme_settings_alter function ofcourse.
Then, I selected the Claro theme as standard and admin theme, cleared again the caches but here there was no error.
So, probably the error could be in core. But then only for the Olivero theme. Something must have changed between Drupal 10 and 11.
I don't know if these tests will help you?
I will look further in list of issues for the core 11.
Thank you,
Eric
Comment #5
ericvlI've made a new issue in the core. It had nothing to do with this great module here.
You can close this issue here if you want.
Sorry to bother you, Alaa.
Greetings
Comment #6
flashwebcenterHi,
No problem at all, and thank you for the update and for opening a core issue.
Best wishes,
Alaa