Problem/Motivation

In #2659940: Extension System, Part III: ThemeExtensionList and ThemeEngineExtensionList, the responsibility of managing the list of themes and theme data is moved to \Drupal::service('extension.list.theme'). This issue is a follow up to deprecate ThemeHandlerInterface::rebuildThemeData() and replace it with calls to \Drupal::service('extension.list.theme')->reset() and \Drupal::service('extension.list.theme')->getList()

Proposed resolution

Replace all usages and deprecate ThemeHandlerInterface::rebuildThemeData() and trigger a silenced error. Also, when replacing the usages we should ensure that we don't unnecessarily rebuild the module list.

Remaining tasks

Review MR
From "Proposed resolution"

Also, when replacing the usages we should ensure that we don't unnecessarily rebuild the module list.

Review CR

User interface changes

None

API changes

None

Data model changes

None

Issue fork drupal-2942001

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

almaudoh created an issue. See original summary.

gaurav.kapoor’s picture

Assigned: Unassigned » gaurav.kapoor
gaurav.kapoor’s picture

StatusFileSize
new8.89 KB

I have worked a little bit on this much. Did changes at some places and also added @deprecated notice wherever. This patch is only useful once parent issue is fixed. Looking for a good review on this one.
Thanks in advance.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

alexpott’s picture

Title: Deprecate ThemeHandlerInterface::rebuildThemeData() and replace with ThemeExtensionList::rebuildThemeData() » Deprecate ThemeHandlerInterface::rebuildThemeData() and use extension.list.theme service instead
alexpott’s picture

Status: Active » Needs review
StatusFileSize
new14.04 KB

Here's a start. Still need to sort out the ThemeInstaller. Ideally we wouldn't need the ThemeHandler there. But then we'd need to sort out issues with reseting the list in ThemeHandler.

andypost’s picture

+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
@@ -72,6 +72,8 @@ protected function setUp() {
+   * @group legacy
+   * @expectedDeprecation \Drupal\Core\Extension\ThemeHandlerInterface::rebuildThemeData() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal::service('extension.list.theme')->reset()->getList() instead. See https://www.drupal.org/node/2709919.

Maybe better to create common ThemeHandlerLegacyTest - it will be easy to remove it in 9.0
I'm Adding it in #3017231-4: Properly deprecate ThemeHandlerInterface install() and uninstall() also replace usage

andypost’s picture

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new143 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dimitriskr made their first commit to this issue’s fork.

dimitriskr’s picture

dimitriskr’s picture

Status: Needs work » Needs review
quietone’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

To answer a question posted in Slack, this needs a separate change record. A change record is for documenting the first version and branch where the change was introduced. When you want to add related issues that can be done in the issue links fields or even in the description body.

For this issue, the changes to the existing change record should move to a new change record. And the new change record can refer to the older one.

I do know the existing change record does not follow what I describe above and it is on my list to update that.

prashant.c’s picture

Assigned: gaurav.kapoor » Unassigned
dimitriskr’s picture

Issue summary: View changes
Issue tags: -Needs change record updates

Updated tasks in IS

dimitriskr’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs change record
smustgrave’s picture

Status: Needs review » Needs work

Left some small comments.

dimitriskr’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Feedback appears to be addressed.

  • catch committed 0b908630 on 10.3.x
    Issue #2942001 by dimitriskr, alexpott, gaurav.kapoor, smustgrave,...

  • catch committed c1ac4451 on 11.x
    Issue #2942001 by dimitriskr, alexpott, gaurav.kapoor, smustgrave,...
catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Includes constructor deprecations for things that need them and doesn't bother for things that don't. Had to read through a couple of times to check, but I think it's a good balance.

Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!

wim leers’s picture

andypost’s picture

Status: Fixed » Closed (fixed)

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