ThemeNegotiator::determineActiveTheme() should not require a RouteMatch to be passed in

Created on 25 June 2014, over 10 years ago
Updated 5 June 2023, over 1 year ago

Problem/Motivation

#2238217: Introduce a RouteMatch class removed the getActiveTheme() method. Granted, not much was using it, but that is changing (two patches in the queue were using it and broke).

Now instead of calling that method, a properly injected class also has to inject a RouteMatch and pass it along. All I want is the current theme, I should be able to ask the theme negotiator for that.

In addition to all of the other classes implementing ThemeNegotiatorInterface, ThemeNegotiator is the one acting as the service, and has the extra methods to gather and delegate. This is similar to BreadcrumbManager, which implements BreadcrumbBuilderInterface.

Proposed resolution

Remove the RouteMatch parameter from determineActiveTheme(), so it serves as a replacement for getActiveTheme().
Inject RouteMatch into any theme negotiators that need it via their service definition.

Additionally, add a new interface for the addNegotiator() method that only ThemeNegotiator (the service class) implements.

Remaining tasks

N/A

User interface changes

N/A

API changes

ThemeNegotiatorInterface::determineActiveTheme() no longer takes any parameters.
Theme negotiators that need a route match should inject it via their service definition.

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Theme 

Last updated 29 minutes ago

Created by

🇺🇸United States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

Production build 0.71.5 2024