Drupal 10 compatibility

Created on 28 February 2023, over 1 year ago
Updated 29 April 2024, about 2 months ago

Problem/Motivation

This theme is based on Core's Classy theme, which has been deprecated in Drupal 9.5.0 and will be removed in Drupal 10.0.0.

Proposed resolution

Follow Core's recommendations for adjusting themes that are derived from the Classy theme in this Change Record → . This will be either introducing a dependency to a contributed project (the Classy theme will continue to live in contrib space), or adjust the theme by copying things over from the Core Classy theme. The latter seems reasonable for a generic base theme such as Bootstrap for Drupal.

Remaining tasks

Adjust theme to be compatible following recommendations in the Change Record:

  1. Change the base theme to Stable.
  2. Copy the preprocess functions from classy.theme to the .theme file of your new theme. Rename the functions to begin with yourthemename_ instead of classy_
  3. Determine which Classy .html.twig templates are not overridden by your theme and copy them anywhere within your theme's /templates directory.
  4. Migrate libraries:
    • Review classy.libraries.yml and determine which libraries defined there are not overridden by your theme,
    • Copy the non-overriden library definitions to your_theme.info.yml. Once copied over, we recommend prefixing the library names with .classy so it's clear which libraries were formerly from Classy.
    • The js/css assets referenced by the new libraries should be copied from Classy to your theme. Maintain the same directory structure within the theme to avoid having to change any library definitions.
    • In the CSS copied from Classy, review any references to images, such as url(../../core/misc/some-image.jpg). Update the image paths to work with your theme, and images you want from /core/themes/classy/images should be copied to your theme.
📌 Task
Status

RTBC

Version

2.66

Component

Code

Created by

🇩🇪Germany jensschuppe

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

Comments & Activities

  • Issue created by @jensschuppe
  • 🇩🇪Germany jensschuppe

    There might be extra work necessary if the dependency to the Stable base theme is to be removed as well, since Stable got deprecated in 9.5.0, too, and Classy is based on Stable. See the Change Record → for removing Stable from Core.

  • Status changed to Needs review about 1 year ago
  • 🇩🇪Germany jensschuppe

    The issue fork now contains three commits on its 8.x-2.x branch:

    • Issue #3296630 Automated Drupal 10 compatibility fixes
    • Issue #3344945 Depend on the Classy contrib theme
    • Issue #3344945 Denote Drupal 10 compatibility

    I.e. including the automated patch created by Drupal rector in #3296630, depending on the now-contrib Classy theme (keeping current base theme dependency) and adding ^10 to core_version_requirement.

    This should make the theme installable with Drupal 10, we were at least able to do this successfully.

    The Classy contrib theme does not depend on the Stable contrib theme so my comment above can be ignored.

    If it's not desirable to introduce a dependency to a contrib theme, there's some more work to do, as described in the change records.

  • 🇩🇪Germany jensschuppe

    Fixed another Drupal 10 incompatibility with Issue #3344945 Drupal 10: Fix Twig syntax error Unknown "spaceless" tag in the issue fork branch.

  • 🇩🇪Germany jensschuppe

    Fixed another Drupal 10 incompatibility with Issue #3344945 Replace removed function `file_create_url()` in the issue fork branch.

  • 🇩🇪Germany jensschuppe

    Fixed another Drupal 10 incompatibility in the issue fork branch (Denote Drupal 10 compatibility for sub-theme template).

  • @frogdog_tech opened merge request.
  • Status changed to RTBC 8 months ago
  • 🇮🇳India Bushra Shaikh

    I applied MR !4 this wokrks for Drupal 9.5.10 and Drupal 10.0. and 10.0.1
    Screenshots of the compatibility on 9.5 have been attached for reference:

    Can be move to RTBC+1

  • 🇺🇸United States jlancaster

    I have also reviewed the pending merge request changes on a D10.1.6 site of mine that depends on bfd and confirmed the upgrade to D10 is successful and no errors/regressions are present.

  • 🇬🇧United Kingdom marcelovani London

    +1 for a new release for Drupal 10.
    Also, can we have a dev release available? It would make it easier to require the dev branch with Composer.

  • 🇪🇪Estonia pjotr.savitski

    I've uploaded bfd-drupal-10-support.patch file as it has a few additional changes that made the Upgrade Status → module happy. Those include changes to a few more templates that are not really used, unless content types are present.

    The main difference is the change to the global-styling library that removes core/popperjs and core/jquery-once. The first one is solved by using a bundle version of Bootstrap that includes the dependency, while the latter one does not seem to be used by the theme JS file at all.

    One additional change is to get rid of Drupal 8 support because that version has already been discontinued a long time ago. To be honest, a later release could remove the Drupal 9 support. I've kept it to be able to make sure that everything is working as expected while still using version 9 and then migrate to 10.

    Community versions of Classy and Stable themes seem to be doing the trick for Drupal 10, although not having those required would be a plus and a possibility to further migrate to version 11.

  • 🇨🇦Canada earthangelconsulting

    thanks for all these patches, awesome people. i will give this a shot.

    has anyone tried this on D10.2 yet? or just D10.1 ?

    (needless to say... "+1 for a new release for Drupal 10.")

Production build 0.69.0 2024