Can't create working subtheme

Created on 19 April 2023, over 1 year ago

Problem/Motivation

I am trying to create a subtheme by copying socialblue and modifying files. But when I try to use the theme I get the following:

Error: Class "Drupal\socialbase\Plugin\Alter\ThemeSuggestions" not found in include() (line 14 of themes/custom/sunshine/src/Plugin/Alter/ThemeSuggestions.php).

include() (Line: 582)
Composer\Autoload\{closure}() (Line: 433)
Composer\Autoload\ClassLoader->loadClass()
class_exists() (Line: 96)
Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (Line: 17)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 84)
Drupal\bootstrap\Plugin\PluginManager->createInstance() (Line: 302)
Drupal\bootstrap\Bootstrap::alter() (Line: 148)
bootstrap_theme_suggestions_alter() (Line: 449)
Drupal\Core\Theme\ThemeManager->alterForTheme() (Line: 458)
Drupal\Core\Theme\ThemeManager->alter() (Line: 245)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 110)
Drupal\Core\Entity\Controller\EntityViewController->buildTitle()
call_user_func_array() (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 788)
Drupal\Core\Render\Renderer->doCallback() (Line: 374)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 243)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

1. Copy socialblue directory to themes/custom
2. Replace "socialblue" with "newthemename" in appropriate files, including in src/plugin/altern & preprocess.
3. Set newthemename as default.
4. Drush cr
5. Go to homepage.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

11.9

Component

Code (back-end)

Created by

πŸ‡ΊπŸ‡ΈUnited States rsbecker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rsbecker
  • πŸ‡ΊπŸ‡ΈUnited States rsbecker

    I eventually figured out that there was a problem in my composer.json file that put things in the wrong places. I have corrected that, but now I'm getting the following error.

    Error: Call to undefined function _social_group_get_current_group() in socialbase_group_link() (line 44 of themes/contrib/socialbase/socialbase.theme).
    
    socialbase_group_link() (Line: 125)
    Drupal\socialbase\Plugin\Preprocess\Node->preprocessElement() (Line: 24)
    Drupal\sunshine\Plugin\Preprocess\Node->preprocessElement() (Line: 51)
    Drupal\bootstrap\Plugin\Preprocess\PreprocessBase->preprocess() (Line: 1443)
    Drupal\bootstrap\Bootstrap::preprocess() (Line: 118)
    bootstrap_preprocess()
    call_user_func_array() (Line: 287)
    Drupal\Core\Theme\ThemeManager->render() (Line: 433)
    Drupal\Core\Render\Renderer->doRender() (Line: 204)
    Drupal\Core\Render\Renderer->render() (Line: 242)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 243)
    Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 132)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    call_user_func() (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 174)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
    Stack\StackedHttpKernel->handle() (Line: 718)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    

    Thanks

Production build 0.71.5 2024