Not able to install a subtheme in Drupal 10

Created on 7 January 2023, over 1 year ago
Updated 7 June 2024, 18 days ago

Hi,

I cannot install Adaptive themes in Drupal 10.0.1.

The situation

I have a 9.5 Drupal installation that works with a subtheme of Adaptive. I cloned it on a test server (Ubuntu 22.04.1 LTS, php 8.1, Composer 2.5.1) and I managed to make it 100% Drupal10-reay using the Upgrade Status module. So far, so good in 9.5.0. To do that I had to uninstall Adaptive theme and its tools and to delete all tracks of its existence (not an easy task). I deleted all references to โ€˜stable themeโ€™ as well.

Now, in Drupal 10.0.1 I can install and uninstall Olivero or some other themes (DXPR, for instance). Everything is ok. To install Adaptive themes (following the instructions given in its pages in Drupal.org, version 5.1), I enabled its modules (version: 2.0) and changed the info.yml file of my subtheme (generated with AT tool) to say: โ€œcore_version_requirement: '^8 || ^9 || ^10', as referred in another issue in Drupal.org.

The trouble

Now, my new AT subtheme is shown in the Appearance page but there is no link to install it. Instead there is a message that says: โ€œRequires: stable (missing)โ€ and โ€œThis theme requires the base theme at_core to operate correctlyโ€.

The issue/questions

So, the questions are:

  1. How (or why) do I enable a theme that is deprecated in Drupal 10 (stable)?
  2. How (or why) do I enable a theme that seems to be installed but does not show (at_core)?
  3. Are Adaptive Themes really ready for Drupal 10 (if so there seems to be some information missing for its installation)?

I can provide whatever information needed and I am ready to try any solution (as it is a trial server, not on production).

Thanks a lot in advance :)

๐Ÿ’ฌ Support request
Status

Active

Version

5.1

Component

Theme Settings

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain gusgsm1

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States brianbrarian

    I'm also encountering the "deprecated function: str_replace()" error when I try to change the color scheme through the subtheme's AT interface.

  • First commit to issue fork.
  • @rushiraval opened merge request.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    I am using drupal 10.1.2 getting error during new sub-theme generate.

    Deprecated function: file_get_contents(): Passing null to parameter #2 ($use_include_path) of type bool is deprecated in Drupal\at_theme_generator\Theme\ThemeGenerator->rewritePageLayoutCSS() (line 340 of modules/contrib/at_tool/at_theme_generator/src/Theme/ThemeGenerator.php).
    Drupal\at_theme_generator\Theme\ThemeGenerator->rewritePageLayoutCSS() (Line: 47)
    Drupal\at_theme_generator\Theme\ThemeGeneratorTypes->starterkitGenerator() (Line: 422)
    Drupal\at_theme_generator\Form\GeneratorForm->submitForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 114)
    

    The new custom theme folder is generating but getting info file issue as -
    This theme is not compatible with Drupal 10.1.2. Check that the .info.yml file contains a compatible 'core' or 'core_version_requirement' value.
    I find that core_version_requirement is not with for drupal-10. I think this will manage from at_sub_theme generator module.

    I am using drupal 10.1.2 and composer require 'drupal/adaptivetheme:^5.1'

  • ๐Ÿ‡ง๐Ÿ‡ทBrazil astutonet Sao Paulo, SP

    Another one with the same issue.

    I installed the AdaptiveTheme 5.1 theme (composer require 'drupal/adaptivetheme:^5.1') and the AT Tool 2.0.3 module (composer require 'drupal/at_tool:^2.0'). I'm using Drupal 10.1.6.

    I enabled the module and went to generate the subtheme, but I realized that the AdaptiveTheme 5.1 was not available to be enabled.

    Even so, I generated the subtheme and when trying to enable it, I saw the following message: "This theme needs the at_core base theme to work correctly."

    If the base theme is there, but cannot be enabled because it does not work as desired, I think we have a bug and this issue should be treated as such, even so that it gets the attention it needs.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada sagesolutions

    I am in the middle of a D10 upgrade. Looking into at_core.info.yml file, the base theme is using the deprecated theme stable and needs to be updated to stable9.

    name: 'AT Core'
    type: theme
    base theme: stable
    

    Trying to uninstall stable theme returns the following error:

    The base theme stable cannot be uninstalled, because theme at_core depends on it.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada sagesolutions

    After installing the patch #7 From How to remove dependency on core 'stable' theme ๐Ÿ’ฌ How to remove dependency on core 'stable' theme Active I was successfully able to uninstall stable.

  • hi,
    go to /themes/contrib/adaptivetheme/at_core
    edit at_core.info.yml

    base theme: stable9
    dependencies:
    - stable9:stable9

    and check in subtheme info file;
    core_version_requirement: '^9.3 || ^10'

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States rick_p

    #11 worked for me. Many, many thanks for the fast, easy solution!!!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hesco

    @bolaghi's patch worked for me as well.
    Has anyone submitted this change back upstream to resolve this issue?

    -- Hugh

  • does anybody else have problemw with subtheme not being compatible with drupal 10? I get many errors...or did you create a fresh subtheme?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    @tokosefi
    I did not find the issue to generate sub-theme But i think you are cloning wrong version of AT theme.
    The Drupal-10 supporting theme is on different URL that is https://www.drupal.org/project/at_theme โ†’

  • yes i tried to switch from version 2 to version 1 adaptive theme...and I don't know how......
    i used composer but it is not working at all

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bobburns

    I will admit I did not use composer because there are two projects and one does not work

    @tokosefi

    I use it and it works. There is a patch for the $layout_path is deprecated etc it is

    protected $layout_path;

    et cetera for any deprecation that shows up. See eg https://www.drupal.org/project/adaptivetheme/issues/3440936 ๐Ÿ› Deprecated function (still) RTBC

    Use the project/adaptivetheme and at_tool NOT project/at_theme and at_tools - that is not maintained - notice the "s"

    Notice adapative theme is now at 6.0 and at_tool is 3.0

    There are two adaptive theme projects and if you mix them you get the issues you describe

    Install the proper ones once Drupal 10 is working and then generate a new sub theme by slightly changing the name and abandon the old theme, uninstall it and delete it from your files

  • i did....exactly like you wrote....but like i said why is the main menu block not showing the main menu items? the menu is inside but it is empty when I open the site

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States camhoward New Hampshire, USA

    Blocks are theme dependent. If you change your theme, or create a new subtheme and make it your new default theme, you have to place the blocks in the correct region for the new theme.

    Go to Structure > Block layout and place the blocks where you want them. For example, place "Main navigation" in the "Navbar" region.

  • that is exactly what I did....put main menu into NAV block...nothing shows up.....
    bartik and other theme work fine.....
    what is going on with this horrid theme....I even uninstalled both modules and deleted all files for the theme....did fresh install and generated the theme and I get errors....main menu is missing....footer is missing....top block is missing where the admin toolbar module should be show n and the maintanier never helps ....

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States camhoward New Hampshire, USA

    @tokosefi -- I'm sorry to hear that my last post didn't help. I don't have any additional advice. None of my sites are using Drupal 10 with Adaptive Theme.

  • why you dont use adaptive theme? Which theme do you use then?

Production build 0.69.0 2024