Problem/Motivation

After setting seven as the admin theme, opening the theme settings other than seven, crash with the exception.

InvalidArgumentException: Class "seven_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() (Line: 592)
Drupal\Core\Theme\ThemeManager->getImplementationsForTheme() (Line: 556)
Drupal\Core\Theme\ThemeManager->alterForTheme() (Line: 620)
Drupal\Core\Theme\ThemeManager->alter() (Line: 893)
Drupal\Core\Form\FormBuilder->prepareForm() (Line: 304)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_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() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
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: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 745)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Is 3531148 relevant?
https://www.drupal.org/project/seven/issues/3531148
I tried renaming theme-settings.php to seven.theme and the error dissapeared.

Steps to reproduce

  1. Clean install drupal 11.3.
  2. composer require drush/drush
  3. composer require 'drupal/seven:^2.0@beta'
  4. drush thin seven -y
  5. drush config-set system.theme admin seven -y
  6. Login as admin and access /admin/appearance/settings/olivero

Issue fork seven-3567390

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

bkenro created an issue. See original summary.

bkenro’s picture

Issue summary: View changes
avpaderno’s picture

Version: 2.0.0-beta3 » 2.0.x-dev
Assigned: Unassigned » avpaderno
Category: Support request » Bug report

avpaderno’s picture

Status: Active » Needs review

seven_form_system_theme_settings_alter() has not been yet converted to a OOP hook, so it must be marked as legacy hook. I forgot to do it before creating the alpha release.

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

No exceptions/errors are shown/logged in the merge request preview.

  • avpaderno committed a6277a8e on 2.0.x
    Issue #3567390: InvalidArgumentException: Class "...
avpaderno’s picture

Assigned: avpaderno » Unassigned
Status: Reviewed & tested by the community » Fixed

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

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

Maintainers, credit people who helped resolve this issue.

bkenro’s picture

I also confirmed that the problem is solved with seven 2.0.x-dev. Thank you for your quick response.

Status: Fixed » Closed (fixed)

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