Solved - Error with base theme

Created on 1 March 2023, over 1 year ago
Updated 19 December 2023, 6 months ago

I attempted an update from 2.1.16 to 3.0.1.
I ran the drush updb

There were errors with stable9

public_html$ composer require 'drupal/bootstrap4:^3.0'
./composer.json has been updated
Running composer update drupal/bootstrap4
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading drupal/bootstrap4 (2.1.16 => 3.0.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading drupal/bootstrap4 (3.0.1)
  - Upgrading drupal/bootstrap4 (2.1.16 => 3.0.1): Extracting archive
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
50 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.
No security vulnerability advisories found
public_html$ drush updb
 ------------ ------------------------- ------------- -------------------------
  Module       Update ID                 Type          Description
 ------------ ------------------------- ------------- -------------------------
  bootstrap4   install_stable9           post-update   Enable new theme:
                                                       stable9.
  bootstrap4   uninstall_stable_classy   post-update   Uninstall old themes if
                                                       present: stable and
                                                       classy.
 ------------ ------------------------- ------------- -------------------------


 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > yes

>  [warning] Post update function bootstrap4_post_update_install_stable9 not found in file bootstrap4.post_update.php
>  [error]  Update failed: bootstrap4_post_update_install_stable9
 [error]  Update aborted by: bootstrap4_post_update_install_stable9
 [error]  Finished performing updates.
public_html$ drush cr
 [success] Cache rebuild complete.

The result was a WSOD page.

I rolled back the theme to 4 2.1.16 and the site was back.
public_html$ composer require 'drupal/bootstrap4:^2.1'

In the Drupal log I see this:
Drupal\Core\Theme\MissingThemeDependencyException: Base theme stable9 has not been installed. in Drupal\Core\Theme\ThemeInitialization->getActiveThemeByName() (line 115 of /home/customer/www/mysite.ca/public_html/core/lib/Drupal/Core/Theme/ThemeInitialization.php).

Some searching brought this up this related issue.
https://designkojo.com/base-theme-stable9-has-not-been-installed

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada dadderley Vancouver

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

Comments & Activities

  • Issue created by @dadderley
  • πŸ‡¬πŸ‡§United Kingdom chriscant

    There's more info about this issue here for bootstrap5:
    https://www.drupal.org/project/bootstrap5/issues/3337690 πŸ’¬ Upgrade 2.x to 3.x Fixed

    In practice you can get things working by running updates from the user interface as drush updb doesn't work.
    If you aren't logged in then you will need to set update_free_access in settings.php.
    (You don't have to make stable9 visible).

    Other help on that thread says that it works using drush 11 but not drush 10.

  • πŸ‡¨πŸ‡¦Canada dadderley Vancouver

    Thank you chriscant!

    Just for the heck of it I did the update and ran drush updb.
    It croaked of course.

    public_html$ composer require 'drupal/bootstrap4:^3.0'
    ./composer.json has been updated
    Running composer update drupal/bootstrap4
    Loading composer repositories with package information
    Info from https://repo.packagist.org: #StandWithUkraine
    Updating dependencies
    Lock file operations: 0 installs, 1 update, 0 removals
      - Upgrading drupal/bootstrap4 (2.1.16 => 3.0.1)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 0 installs, 1 update, 0 removals
      - Downloading drupal/bootstrap4 (3.0.1)
      - Upgrading drupal/bootstrap4 (2.1.16 => 3.0.1): Extracting archive
    Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
    Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
    Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
    Generating autoload files
    Hardening vendor directory with .htaccess and web.config files.
    52 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    Cleaning installed packages.
    No security vulnerability advisories found
    public_html$ drush updb
     ------------ ------------------------- ------------- -------------------------
      Module       Update ID                 Type          Description
     ------------ ------------------------- ------------- -------------------------
      bootstrap4   install_stable9           post-update   Enable new theme:
                                                           stable9.
      bootstrap4   uninstall_stable_classy   post-update   Uninstall old themes if
                                                           present: stable and
                                                           classy.
     ------------ ------------------------- ------------- -------------------------
    
    
     Do you wish to run the specified pending updates? (yes/no) [yes]:
     > yes
    
    >  [warning] Post update function bootstrap4_post_update_install_stable9 not found in file bootstrap4.post_update.php
    >  [error]  Update failed: bootstrap4_post_update_install_stable9
     [error]  Update aborted by: bootstrap4_post_update_install_stable9
     [error]  Finished performing updates.

    Then I hit https://www.mysite.com/update.php and it updated properly without errors.
    Thanks again.

  • πŸ‡¨πŸ‡¦Canada dadderley Vancouver
  • πŸ‡¨πŸ‡¦Canada dadderley Vancouver
  • Status changed to Fixed over 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia VladimirAus Brisbane, Australia

    Thanks everyone!

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

  • Status changed to Fixed 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States lhridley

    Followup: Note, upgrading to Drush v11+ fixes the problem with the post_update hook, since that is a feature introduced for themes in drush 11. This should be added as a minimum requirement in the theme's composer.json file.

  • πŸ‡ΊπŸ‡ΈUnited States davedg629

    Can the documentation for migrating from 2.x to 3.x be updated? This line doesn't seem to work for anyone:

    Run updates via drupal interface if using drush 10 or less.

    I feel like the following would be more clear.

    Upgrade to branch 3.0.x

    If using Drush 11 (recommended)

    • Run drush updb
    • If errors already appeared, use either drush theme:uninstall claro stable and/or drush theme:install stable9 depending of what php error you'll get.

    If using Drush 10

    • Unhide stable9 by commenting out the "hidden: true" line in web/core/themes/stable9/stable9.info.yml
    • Run database updates via the Drupal interface to complete migration.
  • πŸ‡¦πŸ‡ΊAustralia VladimirAus Brisbane, Australia

    Thanks for sending though changes @davedg629. 🧁
    I updated theme page.

  • πŸ‡ΊπŸ‡ΈUnited States davedg629

    No problem. We should add one thing for the Drush 10 instructions. You need to actually install the stable9 theme after unhiding it. Below are the updated instructions that include this step.

    Upgrade to branch 3.0.x

    If using Drush 11 (recommended)

    • Run drush updb
    • If errors already appeared, use either drush theme:uninstall claro stable and/or drush theme:install stable9 depending of what php error you'll get.

    If using Drush 10

    • Unhide stable9 by commenting out the "hidden: true" line in web/core/themes/stable9/stable9.info.yml
    • Go to Appearance and install the Stable9 theme.
    • Run database updates via the Drupal interface to complete migration.
  • πŸ‡«πŸ‡·France Slown Tours

    Thanks @dadderley #3
    "Then I hit https://www.mysite.com/update.php and it updated properly without errors." is ok for me.

    Merci :-)

Production build 0.69.0 2024