ThemeHandlerInterface::getBaseThemes is deprecated

Created on 3 October 2024, about 1 month ago

Error message:
\Drupal\Core\Extension\ThemeHandlerInterface::getBaseThemes() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. There is no direct replacement.

Core change record: ThemeHandlerInterface::getBaseThemes is deprecated β†’

πŸ“Œ Task
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

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

Comments & Activities

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

    There is a suggested fix in #3451377-7: Automated Drupal 11 compatibility fixes for views_aggregator β†’ contributed by @emptyvoid. I have uploaded a patch containing only the relevant lines here.

    While this might solve the immediate deprecation problem, it seems to be that the whole point of the core issue was that this method shouldn't be needed - that's why there is no direct replacement. When I look at HOW we are using it, it is to make an exception for rendering in Bootstrap-derived themes. To me, that's a code smell - we shouldn't have to do theme-specific stuff.

    That code was added in #2986439: Support for Drupal Bootstrap theme β†’ more than 6 years ago.

    I think we should go back and examine the need for this Bootstrap code and see if it can be eliminated, rather than just trying to find a replacement for getBaseThemes().

    NOTE: Because this method won't be removed from Drupal core until Drupal 12, it is not necessary to fix this for Drupal 11 support. We can leave it and just ignore the Phpstan deprecation warning in the test output until we determine the best solution.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • πŸ‡¦πŸ‡ΉAustria jordik

    Agree, we need to review this. It was a nightmare to style every VAP table separately.
    Probably there is a more elegant way of achieving the same result.

Production build 0.71.5 2024