Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Someone in IRC was having problems with the theme.negotiator.visual_diff service (ended up just needing to clear caches).
While I was helping debug, I read the code in VisualDiffThemeNegotiator, and couldn't figure out why it extended AdminNegotiator from user.module. It overrides all public methods, and uses no helper methods.
Proposed resolution
Remove the dependency and implement ThemeNegotiatorInterface directly
Make isDiffRoute() protected as it is not on any interface
Improve the unit tests to cover each public method separately, and all code paths.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#2 | 2825032-diff_negotiator-2.patch | 8.17 KB | tim.plunkett |
Comments
Comment #2
tim.plunkettNote that if the module was already stable, this would need an empty post_update hook to trigger a container rebuild, since diff.services.yml is changing.
Comment #4
miro_dietikerWonderful, thx for pushing QA with cleanup and test coverage! Committed.